Deploy NextJS PROD #1
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 NextJS PROD" | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: "The branch, tag or SHA to checkout" | |
type: string | |
required: true | |
default: "master" | |
env: | |
NODE_VERSION: "18.X" | |
AWS_REGION: "us-east-1" | |
jobs: | |
deploy: | |
name: "Development deployment" | |
runs-on: ubuntu-22.04 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: "Checkout to deployment ref" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
role-duration-seconds: 1200 # Set the session duration as needed | |
role-session-name: RestakingDashboardGithubAction | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION}} | |
- name: "Install yarn globally" | |
run: npm install --global yarn | |
- name: "Install dependencies" | |
run: yarn install | |
- name: "Build NextJS app" | |
run: yarn build | |
env: | |
NEXT_PUBLIC_SPICE_PROXY_API_URL: ${{ secrets.NEXT_PUBLIC_SPICE_PROXY_API_URL_PROD }} | |
NEXT_PUBLIC_MAINNET_RPC_URL: ${{ secrets.NEXT_PUBLIC_MAINNET_RPC_URL }} | |
NEXT_PUBLIC_GOERLI_RPC_URL: ${{ secrets.NEXT_PUBLIC_GOERLI_RPC_URL }} | |
- name: "Update S3 Bucket" | |
run: aws s3 sync out ${{ secrets.AWS_S3_BUCKET_PROD }} --delete |