Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TreasureProject/treasure-website …
Browse files Browse the repository at this point in the history
…into update/landing-page
  • Loading branch information
jcheese1 committed Jan 23, 2024
2 parents 5648f32 + ec8e232 commit cfcbf13
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ on:
workflow_dispatch: {}

jobs:
setup:
runs-on: ubuntu-latest
outputs:
sanitized_ref_name: ${{ steps.sanitize_branch_name.outputs.sanitized_ref_name }}
steps:
- name: 📝 Sanitize Branch Name
id: sanitize_branch_name
run: |
SANITIZED_REF_NAME=$(echo "${{ github.ref_name }}" | sed 's|/|-|g')
echo "sanitized_ref_name=$SANITIZED_REF_NAME" >> $GITHUB_ENV
echo "::set-output name=sanitized_ref_name::$SANITIZED_REF_NAME"
typecheck:
name: ʦ TypeScript
runs-on: ubuntu-latest
Expand All @@ -29,7 +41,9 @@ jobs:

- name: 🔎 Type check
run: npm run typecheck --if-present

build:
needs: setup
name: 🐳 Build
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -70,7 +84,7 @@ jobs:
with:
context: .
push: true
tags: registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }}
tags: registry.fly.io/${{ steps.app_name.outputs.value }}:${{ needs.setup.outputs.sanitized_ref_name }}-${{ github.sha }}
build-args: |
COMMIT_SHA=${{ github.sha }}
CONTENTFUL_ENDPOINT=${{ secrets.CONTENTFUL_ENDPOINT }}
Expand All @@ -90,7 +104,7 @@ jobs:
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
needs: [typecheck, build]
needs: [typecheck, build, setup]
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -109,7 +123,7 @@ jobs:
if: ${{ github.ref != 'refs/heads/master' }}
uses: superfly/[email protected]
with:
args: "deploy --app ${{ steps.app_name.outputs.value }}-staging --image registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }}"
args: "deploy --app ${{ steps.app_name.outputs.value }}-staging --image registry.fly.io/${{ steps.app_name.outputs.value }}:${{ needs.setup.outputs.sanitized_ref_name }}-${{ github.sha }}"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Expand Down

0 comments on commit cfcbf13

Please sign in to comment.