From 8fb8c4a58d197f942b3207a8a2917d960b82149c Mon Sep 17 00:00:00 2001 From: "e.an" <55692615+dennislee928@users.noreply.github.com> Date: Thu, 23 May 2024 16:36:44 +0800 Subject: [PATCH] Create deploy.yaml --- .github/workflows/deploy.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..5ed85a4 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -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 \ No newline at end of file