cloudflare_deploy_production #10
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: cloudflare_deploy_production | |
on: | |
push: | |
branches: | |
- master | |
schedule: # Run every 1st of the month at 06:00 UTC, for summarize resume/cv pdf generation | |
- cron: '0 6 1 * *' | |
jobs: | |
nuxt: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
node: [ 18 ] | |
env: | |
NUXT_DIR: nuxt | |
SUMMARIZE_DIR: nuxt/summarize | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Summarize Dependencies | |
run: npm i | |
working-directory: ${{ env.SUMMARIZE_DIR }} | |
- name: Validate Summarize Data | |
run: npm run validate | |
working-directory: ${{ env.SUMMARIZE_DIR }} | |
- name: Install Nuxt Dependencies | |
run: npm i | |
working-directory: ${{ env.NUXT_DIR }} | |
- name: Generate Summarize PDFs | |
run: npm run dev & sleep 15 && cd summarize && npm run compile | |
working-directory: ${{ env.NUXT_DIR }} | |
- name: Build Nuxt | |
run: npm run build | |
working-directory: ${{ env.NUXT_DIR }} | |
env: | |
NITRO_PRESET: cloudflare | |
- name: Publish Nuxt to Cloudflare Workers | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
command: deploy --env production | |
workingDirectory: ${{ env.NUXT_DIR }} |