Skip to content

Commit

Permalink
Added Github Action for virtual pages index
Browse files Browse the repository at this point in the history
  • Loading branch information
chocmake authored Jan 16, 2024
1 parent 55f40d4 commit 014ee62
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/prepare-virtual-pages-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Prepare virtual pages index
on: push
permissions:
contents: write
jobs:
Prepare-Virtual-Pages-Index:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Run build script
run: |
./build-virtual-index.ps1
shell: pwsh
- name: Check for changes
run: |
if git diff --exit-code; then
echo "CHANGED=false" >>${GITHUB_ENV}
else
echo "CHANGED=true" >>${GITHUB_ENV}
fi
shell: bash
- name: Commit changes if they exist
if: env.CHANGED == 'true'
env:
GH_USERNAME: ${{ github.repository_owner }}
GH_USERID: ${{ github.repository_owner_id }}
run: |
git config --global user.email "${GH_USERID}+${GH_USERNAME}@users.noreply.github.com"
git config --global user.name "${GH_USERNAME}"
git add "./assets/js/virtualindex.js"
git commit -m "Virtual pages index updated"
git push

0 comments on commit 014ee62

Please sign in to comment.