cicd: rework workflows #24
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: Automatic deploy to GHPages | |
#deploys the mainnet version to GHPages | |
on: | |
push: | |
branches: | |
- mainnet | |
pull_request: | |
branches: | |
- mainnet | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Install deps | |
run: npm ci | |
- name: Build app | |
run: | | |
./node_modules/.bin/next build | |
env: | |
NEXT_PUBLIC_RPC_URL: "https://mainnet.tezos.marigold.dev/" | |
NEXT_PUBLIC_API_URL: "https://api.tzkt.io" | |
NEXT_PUBLIC_NETWORK_TYPE: "mainnet" | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: out | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# Deploy to the github-pages environment | |
# This doesn't seem to work yet | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
if: ${{ github.ref == 'refs/heads/mainnet' }} | |
id: deployment | |
uses: actions/deploy-pages@v4 |