Merge pull request #170 from algorandfoundation/develop #253
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: Release | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- ".vscode/**" | |
- ".idea/**" | |
permissions: | |
contents: read | |
packages: read | |
jobs: | |
ci-dapp: | |
name: CI Dapp | |
uses: ./.github/workflows/node-ci.yml | |
with: | |
working-directory: ./src/dapp | |
compile-script: npm run typecheck | |
audit-script: npm run audit --audit-level=critical | |
ci-xgov-dapp: | |
name: CI xGov Dapp | |
uses: ./.github/workflows/node-ci.yml | |
with: | |
working-directory: ./src/xgov-dapp | |
pre-run-script: cd ../dapp && npm ci | |
compile-script: npm run typecheck | |
audit-script: npm run audit --audit-level=critical | |
ci-events-dapp: | |
name: CI Events Dapp | |
uses: ./.github/workflows/node-ci.yml | |
with: | |
working-directory: ./src/build-a-bull | |
compile-script: npm run typecheck | |
audit-script: npm run audit --audit-level=critical | |
ci-api: | |
name: CI API | |
uses: ./.github/workflows/node-ci.yml | |
with: | |
working-directory: ./src/voting-metadata-api | |
compile-script: npm run typecheck | |
audit-script: npm run audit --audit-level=critical | |
ci-infrastructure: | |
name: CI Infrastructure | |
uses: ./.github/workflows/node-ci.yml | |
with: | |
working-directory: ./infrastructure | |
audit-script: npm run audit --audit-level=critical | |
ci-algorand: | |
name: Algorand build | |
uses: ./.github/workflows/smart-contract-ci.yml | |
with: | |
working-directory: ./src/algorand | |
build-dapp: | |
name: Build Dapp | |
uses: ./.github/workflows/node-build-zip.yml | |
with: | |
working-directory: ./src/dapp | |
build-path: dist | |
artifact-name: dapp | |
static-site: true | |
static-site-env-prefix: VITE | |
needs: | |
- ci-dapp | |
- ci-algorand | |
build-xgov-dapp: | |
name: Build xGov Dapp | |
uses: ./.github/workflows/node-build-zip.yml | |
with: | |
working-directory: ./src/xgov-dapp | |
pre-run-script: cd ../dapp && npm ci | |
build-path: dist | |
artifact-name: xgov-dapp | |
static-site: true | |
static-site-env-prefix: VITE | |
needs: | |
- ci-xgov-dapp | |
- ci-algorand | |
build-events-dapp: | |
name: Build Events Dapp | |
uses: ./.github/workflows/node-build-zip.yml | |
with: | |
working-directory: ./src/build-a-bull | |
build-path: dist | |
artifact-name: build-a-bull | |
static-site: true | |
static-site-env-prefix: VITE | |
needs: | |
- ci-events-dapp | |
- ci-algorand | |
build-api: | |
name: Build API | |
uses: ./.github/workflows/node-build-zip.yml | |
with: | |
working-directory: ./src/voting-metadata-api | |
artifact-name: api | |
needs: | |
- ci-api | |
build-infrastructure: | |
name: Build Infrastructure | |
uses: ./.github/workflows/node-build-zip.yml | |
with: | |
working-directory: ./infrastructure | |
artifact-name: infrastructure | |
needs: | |
- ci-infrastructure | |
deploy-to-dev: | |
runs-on: ubuntu-latest | |
name: Deploy to TestNet | |
if: github.ref == 'refs/heads/develop' | |
environment: Dev | |
concurrency: "${{ github.workflow }}-dev" | |
needs: | |
- build-dapp | |
- build-xgov-dapp | |
- build-events-dapp | |
- build-infrastructure | |
- build-api | |
steps: | |
- name: Deploy | |
uses: makerxstudio/shared-config/.github/actions/node-deploy-cdk@abd45a2905e45902f3014b9b4a69f669cdf427ae | |
env: | |
NO_BUILD: true | |
DEPLOYMENT_ENVIRONMENT: testnet | |
CDK_DEFAULT_ACCOUNT: ${{ secrets.CDK_DEFAULT_ACCOUNT }} | |
AWS_DEFAULT_REGION: us-west-2 | |
BASE_DOMAIN: algorand.foundation | |
WEBSITE_BUILD_PATH: ${{ github.workspace }}/dapp/dist | |
WEBSITE_BUILD_PATH_XGOV: ${{ github.workspace }}/xgov-dapp/dist | |
WEBSITE_BUILD_PATH_BAB: ${{ github.workspace }}/build-a-bull/dist | |
API_BUILD_PATH: ${{ github.workspace }}/api/build | |
IPFS_API_TOKEN: ${{ secrets.IPFS_API_TOKEN }} | |
NODE_ENV: production | |
API_ALLOWED_ADDRESSES: ${{ vars.CREATOR_ALLOW_LIST_ADDRESSES }} | |
API_BINARY_CONTENT_TYPES: 'image/*' | |
with: | |
app-artifact-unzips: |- | |
dapp:dapp/dist | |
xgov-dapp:xgov-dapp/dist | |
build-a-bull:build-a-bull/dist | |
api:api/build | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_ACCESS_KEY_SECRET }} | |
aws-region: us-west-2 | |
static-site-transforms: |- | |
VITE_ALGOD_NODE_CONFIG_TOKEN:${{ secrets.ALGOD_NODE_CONFIG_TOKEN }} | |
VITE_ALGOD_NODE_CONFIG_SERVER:${{ vars.ALGOD_NODE_CONFIG_SERVER }} | |
VITE_ALGOD_NODE_CONFIG_PORT:${{ vars.ALGOD_NODE_CONFIG_PORT }} | |
VITE_ALGOD_NETWORK:${{ vars.ALGOD_NETWORK }} | |
VITE_INDEXER_SERVER:${{ vars.INDEXER_SERVER }} | |
VITE_INDEXER_PORT:${{ vars.INDEXER_PORT }} | |
VITE_INDEXER_TOKEN:${{ secrets.INDEXER_TOKEN }} | |
VITE_ENVIRONMENT:${{ vars.ENVIRONMENT}} | |
VITE_IPFS_GATEWAY_URL:${{ vars.IPFS_GATEWAY_URL }} | |
VITE_ALGO_EXPLORER_URL: ${{ vars.ALGO_EXPLORER_URL }} | |
VITE_NFT_EXPLORER_URL: ${{ vars.NFT_EXPLORER_URL }} | |
VITE_IS_TESTNET: ${{ vars.IS_TESTNET }} | |
VITE_XGOV_CREATOR_ALLOW_LIST: ${{ vars.XGOV_CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_HACKATHON_CREATOR_ALLOW_LIST: ${{ vars.HACKATHON_CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_CREATOR_ALLOW_LIST: ${{ vars.CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_HIDDEN_VOTING_ROUND_IDS: ${{ vars.HIDDEN_VOTING_ROUND_IDS }} | |
VITE_XGOV_GOVENERS_URL: ${{ vars.XGOV_GOVENERS_URL }} | |
VITE_XGOV_TERM_POOLS_URL: ${{ vars.XGOV_TERM_POOLS_URL }} | |
deploy-to-prod: | |
runs-on: ubuntu-latest | |
name: Deploy to Prod | |
environment: Prod | |
concurrency: "${{ github.workflow }}-prod" | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- build-dapp | |
- build-xgov-dapp | |
- build-events-dapp | |
- build-infrastructure | |
- build-api | |
steps: | |
- name: Deploy | |
uses: makerxstudio/shared-config/.github/actions/node-deploy-cdk@abd45a2905e45902f3014b9b4a69f669cdf427ae | |
env: | |
NO_BUILD: true | |
DEPLOYMENT_ENVIRONMENT: prod | |
CDK_DEFAULT_ACCOUNT: ${{ secrets.CDK_DEFAULT_ACCOUNT }} | |
AWS_DEFAULT_REGION: us-west-2 | |
BASE_DOMAIN: algorand.foundation | |
WEBSITE_BUILD_PATH: ${{ github.workspace }}/dapp/dist | |
WEBSITE_BUILD_PATH_XGOV: ${{ github.workspace }}/xgov-dapp/dist | |
WEBSITE_BUILD_PATH_BAB: ${{ github.workspace }}/build-a-bull/dist | |
API_BUILD_PATH: ${{ github.workspace }}/api/build | |
IPFS_API_TOKEN: ${{ secrets.IPFS_API_TOKEN }} | |
NODE_ENV: production | |
API_ALLOWED_ADDRESSES: ${{ vars.CREATOR_ALLOW_LIST_ADDRESSES }} | |
API_BINARY_CONTENT_TYPES: 'image/*' | |
with: | |
app-artifact-unzips: |- | |
dapp:dapp/dist | |
xgov-dapp:xgov-dapp/dist | |
build-a-bull:build-a-bull/dist | |
api:api/build | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_ACCESS_KEY_SECRET }} | |
aws-region: us-west-2 | |
static-site-transforms: |- | |
VITE_ALGOD_NODE_CONFIG_TOKEN:${{ secrets.ALGOD_NODE_CONFIG_TOKEN }} | |
VITE_ALGOD_NODE_CONFIG_SERVER:${{ vars.ALGOD_NODE_CONFIG_SERVER }} | |
VITE_ALGOD_NODE_CONFIG_PORT:${{ vars.ALGOD_NODE_CONFIG_PORT }} | |
VITE_ALGOD_NETWORK:${{ vars.ALGOD_NETWORK }} | |
VITE_INDEXER_SERVER:${{ vars.INDEXER_SERVER }} | |
VITE_INDEXER_PORT:${{ vars.INDEXER_PORT }} | |
VITE_INDEXER_TOKEN:${{ secrets.INDEXER_TOKEN }} | |
VITE_ENVIRONMENT:${{ vars.ENVIRONMENT}} | |
VITE_IPFS_GATEWAY_URL:${{ vars.IPFS_GATEWAY_URL }} | |
VITE_ALGO_EXPLORER_URL: ${{ vars.ALGO_EXPLORER_URL }} | |
VITE_NFT_EXPLORER_URL: ${{ vars.NFT_EXPLORER_URL }} | |
VITE_IS_TESTNET: ${{ vars.IS_TESTNET }} | |
VITE_XGOV_CREATOR_ALLOW_LIST: ${{ vars.XGOV_CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_HACKATHON_CREATOR_ALLOW_LIST: ${{ vars.HACKATHON_CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_CREATOR_ALLOW_LIST: ${{ vars.CREATOR_ALLOW_LIST_ADDRESSES }} | |
VITE_HIDDEN_VOTING_ROUND_IDS: ${{ vars.HIDDEN_VOTING_ROUND_IDS }} | |
VITE_XGOV_GOVENERS_URL: ${{ vars.XGOV_GOVENERS_URL }} | |
VITE_XGOV_TERM_POOLS_URL: ${{ vars.XGOV_TERM_POOLS_URL }} |