Skip to content

Commit

Permalink
Create deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dennislee928 committed May 23, 2024
1 parent 268b7ef commit 8fb8c4a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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

0 comments on commit 8fb8c4a

Please sign in to comment.