Deploy front-page to Cloudflare Pages #4
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 front-page to Cloudflare Pages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- frontpage2/** | |
- frontstage_deploy(production).yaml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- frontpage2/** | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' # Use a stable LTS version of Node.js | |
- name: Install dependencies | |
working-directory: ./frontpage2 | |
run: npm install | |
- name: Build | |
env: | |
NUXT_PUBLIC_API_BASE: '' | |
working-directory: ./frontpage2 | |
run: npx nuxt generate | |
- name: Install Wrangler | |
run: npm install -g wrangler | |
- name: Deploy to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUD_FLARE_DEPLOY_API_TOKEN }} | |
accountId: ${{ secrets.CLOUD_FLARE_DEPLOY_ACCOUNT_ID }} | |
command: pages deploy ./frontpage2/dist --project-name=bloody-mickey --commit-dirty=true | |
quiet: false |