-
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 pull request #9 from gnosischain/dev
Sync dev and main branch
- Loading branch information
Showing
8 changed files
with
98 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Automatic Deployment to Dev/Staging | ||
|
||
on: | ||
# Launches for pushes to main or dev | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
VITE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.VITE_WALLET_CONNECT_PROJECT_ID }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deployment | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20.3.0' | ||
|
||
- name: Install | ||
run: | | ||
rm -rf .cache | ||
rm -rf build | ||
yarn config set cache-folder .yarn | ||
yarn install | ||
pip install awscli --upgrade --user | ||
- name: Build App | ||
run: yarn build | ||
|
||
- name: Configure AWS Development credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
if: ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' ) | ||
with: | ||
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.DEV_AWS_DEFAULT_REGION }} | ||
|
||
# Script to deploy to development environment | ||
- name: 'Deploy to S3: Development' | ||
if: github.ref == 'refs/heads/dev' | ||
run: | | ||
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete | ||
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete | ||
# Script to deploy to staging environment | ||
- name: 'Deploy to S3: Staging' | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public --delete | ||
aws s3 sync dist/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --delete | ||
- name: 'Cloudfront: cache invalidation' | ||
run: | | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_AWS_CLOUDFRONT_ID }} --paths "/*" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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
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
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
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
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