refactor(env): centralize base URL handling and update image download… #175
This file contains hidden or 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 to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: write # allow pushing to gh-pages | |
id-token: write # if you ever need OIDC | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
env: | |
PRISMIC_ACCESS_TOKEN: ${{ secrets.PRISMIC_ACCESS_TOKEN }} | |
- name: Static HTML export with Nuxt | |
run: pnpm run build:github-pages | |
env: | |
PRISMIC_ACCESS_TOKEN: ${{ secrets.PRISMIC_ACCESS_TOKEN }} | |
NUXT_ALBATROSS_NODE_RPC_URL: ${{ secrets.NUXT_ALBATROSS_NODE_RPC_URL }} | |
NUXT_PUBLIC_CRYPTO_MAP_SUPABASE_KEY: ${{ secrets.NUXT_PUBLIC_CRYPTO_MAP_SUPABASE_KEY }} | |
NUXT_HUB_ENV: ${{ vars.NUXT_HUB_ENV }} | |
NUXT_HUB_PROJECT_KEY: ${{ vars.NUXT_HUB_PROJECT_KEY }} | |
NUXT_PUBLIC_CRYPTO_MAP_SUPABASE_URL: ${{ vars.NUXT_PUBLIC_CRYPTO_MAP_SUPABASE_URL }} | |
NUXT_PUBLIC_VALIDATORS_API: ${{ vars.NUXT_PUBLIC_VALIDATORS_API }} | |
NUXT_SITE_ENV: production | |
NUXT_PUBLIC_WORDS_CHALLENGE_PUBLIC_ADDRESS: ${{ secrets.NUXT_PUBLIC_WORDS_CHALLENGE_PUBLIC_ADDRESS }} | |
NUXT_PUBLIC_WORDS_CHALLENGE_FIRST_REAL_WORDS: ${{ secrets.NUXT_PUBLIC_WORDS_CHALLENGE_FIRST_REAL_WORDS }} | |
- name: Deploy to gh-pages | |
if: github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./.output/public | |
publish_branch: gh-pages # default is "gh-pages" anyway | |
force_orphan: true # orphan the branch so it only contains your latest build | |
allow_empty_commit: true # in case nothing changed | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
commit_message: ${{ github.event.head_commit.message }} |