Add Location docs (#299) #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
rm -rf screenshots/ | |
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 |