forked from ericallam/docrails
-
-
Notifications
You must be signed in to change notification settings - Fork 277
39 lines (34 loc) · 1.08 KB
/
deploy_hook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deploy Hook
on:
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
jobs:
event:
runs-on: ubuntu-latest
steps:
- name: 📥 Download codes from GitHub
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: ✅️ Check if contents changed
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
contents:
- 'guides/**'
- name: 🚀 Deploy if contents changed
if: steps.changes.outputs.contents == 'true'
env:
DEPLOY_HOOK_TOKEN: ${{ secrets.DEPLOY_HOOK_TOKEN }}
DEPLOY_HOOK_ENDPOINT: ${{ secrets.DEPLOY_HOOK_ENDPOINT }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ env.DEPLOY_HOOK_TOKEN }}" \
${{ env.DEPLOY_HOOK_ENDPOINT }} \
-d '{"ref":"master"}'