generated from TreasureProject/web3-frontend-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:TreasureProject/treasure-website …
…into update/landing-page
- Loading branch information
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -29,7 +41,9 @@ jobs: | |
|
||
- name: 🔎 Type check | ||
run: npm run typecheck --if-present | ||
|
||
build: | ||
needs: setup | ||
name: 🐳 Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -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 }} | ||
|
@@ -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] | ||
|
@@ -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 }} | ||
|
||
|