Github
Deploy a Repository
to deploy a repository on push
get deploy token
add webhook on github
go to Settings
→ Webhooks
→ Add webhook
- Payload URL:
https://canary.example.com/webhook/project/BR6N23AZAPoLzpX...
- Content type:
application/json
Example Screenshot
Deploy a Static Page
get deploy token
set host and token
$ gh variable set CANARY_HOST --body canary.example.com
$ gh secret set CANARY_TOKEN --body BR6N23AZAPoLzpX..
Example Workflow
name: Deploy Static Page
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
run: |
tar cf payload.tar -C public/ .
curl -X POST -T payload.tar https://${{ vars.CANARY_HOST }}/webhook/page/${{ secrets.CANARY_TOKEN }}
Was this page helpful?