ci: test deploy #83
Workflow file for this run
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
name: deploy | |
on: | |
push: | |
branches: [master, ci/deploy-to-sub-accounts] | |
tags: ['v*'] | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Set up Node.js 18.x | |
# https://github.com/actions/setup-node/releases/tag/v3.7.0 | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 | |
with: | |
node-version: 18.x | |
- name: Cache node modules | |
# https://github.com/actions/cache/releases/tag/v3.3.1 | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: /home/runner/work/hathor-explorer/hathor-explorer/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
run: | | |
npm install | |
tar -cvf node_modules.tar ./node_modules | |
- name: Upload node modules | |
uses: actions/upload-artifact@v2 | |
with: | |
name: node_modules | |
path: node_modules.tar | |
if-no-files-found: error | |
retention-days: 1 | |
deploy-testnet-explorer: | |
if: github.ref == 'refs/heads/master' | |
needs: dependencies | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Configure AWS Credentials | |
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2 | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRole | |
- name: Download node modules | |
# https://github.com/actions/download-artifact/releases/tag/v3.0.2 | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: node_modules | |
- name: Build | |
run: | | |
tar -xf node_modules.tar | |
make testnet_build | |
- name: Deploy Testnet Explorer | |
run: | | |
make testnet_deploy | |
env: | |
CLOUDFRONT_ID: E2TGO5SVP34CC3 | |
deploy-nano-testnet-explorer: | |
if: github.ref == 'refs/heads/master' | |
needs: dependencies | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Configure AWS Credentials | |
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2 | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
aws-region: eu-central-1 | |
role-to-assume: arn:aws:iam::471112952246:role/ExplorerGitHubActionsRole | |
- name: Download node modules | |
# https://github.com/actions/download-artifact/releases/tag/v3.0.2 | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: node_modules | |
- name: Build | |
run: | | |
tar -xf node_modules.tar | |
make nano_testnet_build | |
- name: Deploy Nano Testnet Explorer | |
run: | | |
make nano_testnet_deploy | |
env: | |
CLOUDFRONT_ID: EN58551BWE3XZ | |
deploy-ekvilibro-testnet-explorer: | |
if: github.ref == 'refs/heads/ci/deploy-to-sub-accounts' | |
needs: dependencies | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Configure AWS Credentials | |
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2 | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
aws-region: eu-central-1 | |
role-to-assume: arn:aws:iam::730335348496:role/ExplorerGitHubActionsRole | |
- name: Download node modules | |
# https://github.com/actions/download-artifact/releases/tag/v3.0.2 | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: node_modules | |
- name: Build | |
run: | | |
tar -xf node_modules.tar | |
make ekvilibro_testnet_build | |
- name: Deploy Ekvilibro Testnet Explorer | |
run: | | |
make ekvilibro_testnet_deploy | |
env: | |
CLOUDFRONT_ID: E3SRP23QB7K3DQ | |
deploy-mainnet-explorer: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: dependencies | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout/releases/tag/v3.5.3 | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Configure AWS Credentials | |
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2 | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRole | |
- name: Download node modules | |
# https://github.com/actions/download-artifact/releases/tag/v3.0.2 | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: node_modules | |
- name: Build | |
run: | | |
tar -xf node_modules.tar | |
make mainnet_build | |
- name: Deploy Mainnet Explorer | |
run: | | |
make mainnet_deploy | |
env: | |
CLOUDFRONT_ID: ETOC9JKCK86OG |