Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ops: better defaulting github action input #3231

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/deploy-canary-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ on:
branches:
- 'staging'
jobs:
setup:
runs-on: ubuntu-latest
name: 'Setup Variable'
steps:
- name: Set default value
id: tag
run: |
TAG=${{ github.event.inputs.tag }}
echo "value=${TAG:-"staging"}" >> "$GITHUB_OUTPUT"
build-frontend:
runs-on: ubuntu-latest
name: 'Build Frontend'
needs: setup
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ steps.tag.outputs.value }}
- uses: actions/setup-node@v3
with:
node-version-file: ./ui/.nvmrc
Expand All @@ -36,7 +46,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ steps.tag.outputs.value }}
- uses: actions/download-artifact@v3
with:
name: 'ui-dist'
Expand All @@ -58,7 +68,7 @@ jobs:
git config --global user.email [email protected]
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ github.event.inputs.tag }}
INPUT=${{ steps.tag.outputs.value }}
BRANCH=${INPUT:-"staging"}
git pull origin $BRANCH --rebase --autostash
git push
Expand All @@ -76,7 +86,7 @@ jobs:
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape-apps groups binnec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape-apps groups binnec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ steps.tag.outputs.value }}
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/deploy-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ on:
branches:
- 'develop'
jobs:
setup:
runs-on: ubuntu-latest
name: 'Setup Variable'
steps:
- name: Set default value
id: tag
run: |
TAG=${{ github.event.inputs.tag }}
echo "value=${TAG:-"staging"}" >> "$GITHUB_OUTPUT"
build-frontend:
runs-on: ubuntu-latest
name: 'Build Frontend'
needs: setup
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ steps.tag.outputs.value }}
- uses: actions/setup-node@v3
with:
node-version-file: ./ui/.nvmrc
Expand All @@ -36,7 +46,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
ref: ${{ steps.tag.outputs.value }}
- uses: actions/download-artifact@v3
with:
name: 'ui-dist'
Expand All @@ -58,7 +68,7 @@ jobs:
git config --global user.email [email protected]
git add desk/desk.docket-0
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit"
INPUT=${{ github.event.inputs.tag }}
INPUT=${{ steps.tag.outputs.value }}
BRANCH=${INPUT:-"develop"}
git pull origin $BRANCH --rebase --autostash
git push
Expand All @@ -79,7 +89,7 @@ jobs:
- id: deploy
name: Deploy
run:
./.github/helpers/deploy.sh tloncorp/landscape-apps groups wannec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ github.event.inputs.tag }}
./.github/helpers/deploy.sh tloncorp/landscape-apps groups wannec-dozzod-marnus us-central1-a mainnet-tlon-other-2d ${{ steps.tag.outputs.value }}
env:
SSH_SEC_KEY: ${{ secrets.GCP_SSH_SEC_KEY }}
SSH_PUB_KEY: ${{ secrets.GCP_SSH_PUB_KEY }}
Expand Down
Loading