-
-
Notifications
You must be signed in to change notification settings - Fork 143
43 lines (41 loc) · 1.47 KB
/
update-docs.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
40
41
42
43
name: Sync docs
on:
push:
branches:
- '*.x'
paths:
- 'packages/admin/docs/**'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cloning docs repository
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git clone --depth=1 --branch ${{ github.ref_name }} https://github.com/shopperlabs/docs.git || git clone https://github.com/shopperlabs/docs.git
cd docs
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
cd ..
echo "Cloned docs repository!"
- name: Copy screenshots assets and content of Content folder
run: |
cp -rf packages/admin/docs/screenshots docs/
cp -rf packages/admin/docs/content/* docs/
echo "Copied updated docs to the laravelshopper.dev repository!"
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
cd docs
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "docs: update documentation with latest changes"
git remote set-url origin https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/shopperlabs/docs.git
git push origin ${{ github.ref_name }}
else
echo "No changes to commit."
fi