Merge pull request #318 from algorandfoundation/arc-56 #117
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 Web | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- '.vscode/**' | |
- '.idea/**' | |
concurrency: deploy-to-production | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
packages: read | |
jobs: | |
ci: | |
name: CI | |
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main | |
with: | |
working-directory: . | |
node-version: 20.x | |
audit-script: npm run audit | |
compile-script: npm run check-types | |
test-script: npm run test | |
pre-test-script: | | |
pipx install algokit | |
algokit localnet start | |
npx --yes wait-on tcp:4001 -t 30000 | |
build-website: | |
name: Build Website | |
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main | |
with: | |
node-version: 20.x | |
build-path: dist | |
artifact-name: website | |
static-site: true | |
static-site-env-prefix: VITE | |
needs: | |
- ci | |
deploy-to-staging: | |
name: Publish Website to Staging | |
needs: | |
- build-website | |
runs-on: [ubuntu-22.04] | |
environment: Staging | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: website | |
path: artifacts | |
- name: Unzip | |
run: | | |
cd artifacts | |
mkdir -p website | |
unzip website.zip -d website | |
- name: Apply Staging Transforms | |
uses: makerxstudio/shared-config/.github/actions/placeholder-transforms@main | |
with: | |
app-artifact-path: artifacts/website | |
static-site-transforms: |- | |
VITE_DISPENSER_AUTH0_DOMAIN:dispenser-staging.eu.auth0.com | |
VITE_DISPENSER_AUTH0_CLIENT_ID:pSffrx40HwIdWAJFeGCsy5FZn2NzYIvO | |
VITE_DISPENSER_AUTH0_AUDIENCE:api-staging-dispenser-user | |
VITE_TESTNET_DISPENSER_API_URL:https://api.dispenser-dev.algorandfoundation.tools | |
VITE_TESTNET_DISPENSER_ADDRESS:A3Q4VQFQ5DLEIWCMUX6V7YFZ7BUPWUXWY4YVNJQODUODSQ7KVEFOZUNFUQ | |
- name: Deploy website to Netlify | |
run: | | |
npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir artifacts/website --prod | |
deploy-to-production: | |
name: Publish Website to Production | |
needs: | |
- deploy-to-staging | |
runs-on: [ubuntu-22.04] | |
environment: Production | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: website | |
path: artifacts | |
- name: Unzip | |
run: | | |
cd artifacts | |
mkdir -p website | |
unzip website.zip -d website | |
- name: Apply Production Transforms | |
uses: makerxstudio/shared-config/.github/actions/placeholder-transforms@main | |
with: | |
app-artifact-path: artifacts/website | |
static-site-transforms: |- | |
VITE_DISPENSER_AUTH0_DOMAIN:dispenser-prod.eu.auth0.com | |
VITE_DISPENSER_AUTH0_CLIENT_ID:Cg13HjvSV45pMme4dnK9yVJde8tVeDaM | |
VITE_DISPENSER_AUTH0_AUDIENCE:api-prod-dispenser-user | |
VITE_TESTNET_DISPENSER_API_URL:https://api.dispenser.algorandfoundation.tools | |
VITE_TESTNET_DISPENSER_ADDRESS:Z5GPJQCHVU54C2I4FLYNE2XHRQRL5OV2GPJQKXJFMW34CRIN2KRQFXF7DI | |
- name: Deploy website to Netlify | |
run: | | |
npx netlify-cli deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir artifacts/website --prod |