Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen-kaia committed Mar 19, 2024
1 parent d84f4e3 commit 6f57948
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/dev_s3_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: klaytn-safe-react dev deploy workflow
on:
push:
branches:
- dev

jobs:
deploy:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN_DEV }}
role-session-name: SessionForKlaytnActions
aws-region: ${{ secrets.AWS_REGION_DEV }}

- name: Installing Node.js
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Installing dependencies
run: |
yarn install
cp -r ./safe-deployment-assets/* ./node_modules/@gnosis.pm/safe-deployments/dist/assets/
cp -r ./safe-deployment-assets/* ./node_modules/@gnosis.pm/safe-core-sdk/node_modules/@gnosis.pm/safe-deployments/dist/assets/
- name: Build static files
env:
REACT_APP_GATEWAY_URL: ${{ secrets.REACT_APP_GATEWAY_URL_DEV }}
run: yarn build

- name: Sync to S3 bucket and validation cloudfront
env:
S3_BUCKET: ${{ secrets.S3_BUCKET_DEV }}
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_DEV }}
run: |
aws s3 sync ./build $S3_BUCKET --delete
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths "/*"
47 changes: 47 additions & 0 deletions .github/workflows/prod_s3_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: klaytn-safe-react production deploy workflow
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
deploy:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN_PROD }}
role-session-name: SessionForKlaytnActions
aws-region: ${{ secrets.AWS_REGION_PROD }}

- name: Installing Node.js
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Installing dependencies
run: |
yarn install
cp -r ./safe-deployment-assets/* ./node_modules/@gnosis.pm/safe-deployments/dist/assets/
cp -r ./safe-deployment-assets/* ./node_modules/@gnosis.pm/safe-core-sdk/node_modules/@gnosis.pm/safe-deployments/dist/assets/
- name: Build static files
env:
REACT_APP_GATEWAY_URL: ${{ secrets.REACT_APP_GATEWAY_URL_PROD }}
run: yarn build

- name: Sync to S3 bucket and validation cloudfront
env:
S3_BUCKET: ${{ secrets.S3_BUCKET_PROD }}
CLOUDFRONT_ID: ${{ secrets.CLOUDFRONT_ID_PROD }}
run: |
aws s3 sync ./build $S3_BUCKET --delete
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths "/*"

0 comments on commit 6f57948

Please sign in to comment.