Skip to content

Instantly share code, notes, and snippets.

@ushitora-anqou
Created September 28, 2023 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ushitora-anqou/628add264694cd24f7eed6f149dab07c to your computer and use it in GitHub Desktop.
Save ushitora-anqou/628add264694cd24f7eed6f149dab07c to your computer and use it in GitHub Desktop.
Qash deploy workflow
name: Deploy
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y libev4
- run: mkdir __bin
- run: wget https://github.com/ushitora-anqou/qash/releases/latest/download/qash -O __bin/qash
- run: chmod u+x __bin/qash
- run: wget https://github.com/ushitora-anqou/qash-fe/releases/latest/download/build.tar.gz
- run: tar xf build.tar.gz
- run: ls
- run: mkdir __build
- run: mv build __build/qash-fe
- run: __bin/qash dump-data-json qash/root.qash > __build/data.json
- run: ls
- uses: actions/upload-artifact@v3
with:
name: cash-page-asset
path: __build
push:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
repository: your-name/your-site
path: __remote
ref: your-branch
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: cash-page-asset
path: cash-page-asset
- run: ls
- run: rsync -av --delete cash-page-asset/qash-fe/ __remote/qash-fe/
- run: rsync -av --delete cash-page-asset/data.json __remote/data.json
- run: tree __remote
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: __remote/
branch: ${{ secrets.CLOUDFLARE_BRANCH }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment