Skip to content

Commit

Permalink
feat: testnet deploy ci script (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio committed Nov 28, 2023
1 parent 60b4e9c commit 983c3f2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
38 changes: 2 additions & 36 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,6 @@ on:
branches: [ main ]

jobs:
testnet_build_and_deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node 12
uses: actions/setup-node@v1
with:
node-version: '12'

- name: Install dependencies
run: yarn

- name: Build site
run: yarn build:testnet

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TESTNET_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TESTNET_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.TESTNET_AWS_REGION }}

- name: Deploy site to S3
run: |
aws s3 sync --delete --only-show-errors build/ ${{ secrets.TESTNET_S3_BUCKET }}
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.TESTNET_CLOUDFRONT_DISTRIBUTION }} --paths "/*"
mainnet_build_and_deploy:

runs-on: ubuntu-latest
Expand All @@ -47,10 +13,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node 12
- name: Setup Node 14
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '14'

- name: Install dependencies
run: yarn
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/testnet-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: RNS build and deploy

on:
push:
branches: [testnet]

jobs:
testnet_build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node 14
uses: actions/setup-node@v1
with:
node-version: "14"

- name: Install dependencies
run: yarn

- name: Build site
run: yarn build:testnet

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TESTNET_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TESTNET_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.TESTNET_AWS_REGION }}

- name: Deploy site to S3
run: |
aws s3 sync --delete --only-show-errors build/ ${{ secrets.TESTNET_S3_BUCKET }}
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.TESTNET_CLOUDFRONT_DISTRIBUTION }} --paths "/*"

0 comments on commit 983c3f2

Please sign in to comment.