28 lines
886 B
YAML
28 lines
886 B
YAML
name: Deploy Pages
|
|
on: push
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
container: alpine:latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- run: apk add nodejs npm rsync
|
|
- uses: actions/checkout@v4
|
|
- run: mkdir /tmp/deploy
|
|
- run: rsync -ua --exclude=".*" . /tmp/deploy
|
|
- name: Set deploy branch
|
|
run: |
|
|
if [ "${{ github.ref_name }}" = "master" ]; then
|
|
echo "DEPLOY_BRANCH=main" >> "$GITHUB_ENV"
|
|
else
|
|
echo "DEPLOY_BRANCH=${{ github.ref_name }}" >> "$GITHUB_ENV"
|
|
fi
|
|
- name: Build & Deploy Worker
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CF_API_TOKEN }}
|
|
accountId: ${{ secrets.CF_ACCOUNT_ID }}
|
|
command: pages deploy /tmp/deploy --project-name=ctmesh-org --branch=${{ env.DEPLOY_BRANCH }}
|