chore: remove screenshots (#295) #19
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/**' | |
env: | |
DOCUMENTATION_REPOSITORY_NAME: laravelshopper.dev | |
SCREENSHOT_PATH: public/img/screenshots/${{ github.ref_name }} | |
DOCUMENTATION_PATH: resources/docs/${{ github.ref_name }} | |
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 https://github.com/shopperlabs/laravelshopper.dev.git | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
echo "Cloned laravelshopper.dev repository!" | |
- name: Create and Copy folders assets | |
run: | | |
mkdir -p "./$DOCUMENTATION_REPOSITORY_NAME/$SCREENSHOT_PATH" | |
mkdir -p "./$DOCUMENTATION_REPOSITORY_NAME/$DOCUMENTATION_PATH" | |
cp -rf packages/admin/docs/content/* "./$DOCUMENTATION_REPOSITORY_NAME/$DOCUMENTATION_PATH/" | |
cp -rf packages/admin/docs/screenshots/* "./$DOCUMENTATION_REPOSITORY_NAME/$SCREENSHOT_PATH/" | |
echo "Copied updated docs to the laravelshopper.dev repository!" | |
- name: Commit and Push Changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
cd $DOCUMENTATION_REPOSITORY_NAME | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "docs: update /resources/docs folder with latest changes" | |
git push https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/shopperlabs/laravelshopper.dev.git | |
else | |
echo "No changes to commit." | |
fi |