-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (27 loc) · 979 Bytes
/
sync-docs.yml
File metadata and controls
30 lines (27 loc) · 979 Bytes
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
name: Sync Docs to Docs Repo
on:
push:
paths:
- 'docs/**'
jobs:
sync-docs:
runs-on: ubuntu-latest
if: "${{ github.event.head_commit.message != 'docs: sync docs' }}"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Sync docs directory
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git config --global user.email "git@marvinjwendt.com"
git config --global user.name "MarvinJWendt"
# Clone using the GH_PAT for authentication
git clone https://x-access-token:${GH_PAT}@github.com/gttp-cli/gttp.git temp_docs
rsync -av --delete docs/ temp_docs/docs/
cd temp_docs
git add .
git commit -m "docs: sync docs"
# Ensure the URL uses the GH_PAT for authentication for future operations
git remote set-url origin https://x-access-token:${GH_PAT}@github.com/gttp-cli/gttp.git
git push origin main