This commit is contained in:
parent
99bb2ecdcd
commit
4f1fe35154
2 changed files with 37 additions and 6 deletions
31
.forgejo/workflows/deploy.yml
Normal file
31
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: node-20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3-pip
|
||||
pip install --break-system-packages -r requirements.txt
|
||||
|
||||
- name: Build site
|
||||
run: python3 generate.py
|
||||
|
||||
- name: Deploy to Cloudflare Pages
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
run: |
|
||||
npx wrangler pages project create ${{ secrets.CF_PAGES_PROJECT_NAME }} --production-branch=main 2>/dev/null || true
|
||||
npx wrangler pages deploy dist/ \
|
||||
--project-name=${{ secrets.CF_PAGES_PROJECT_NAME }} \
|
||||
--commit-dirty=true
|
||||
Loading…
Add table
Add a link
Reference in a new issue