Fixes and tweaks #5
This file contains hidden or 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: Deploy static content to Pages | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ["master"] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| # Page Build Job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Img Generator Script | |
| run: python3 ./.github/scripts/imgListGenerator.py | |
| - name: Check For Changes | |
| id: check_changes | |
| run: | | |
| if [[ -n "$(git diff --exit-code)" ]]; then | |
| echo "Changes detected." | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "No changes detected." | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Push Changes | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| run: | | |
| git config --global user.name "${{github.actor}}" | |
| git config --global user.email "${{github.actor}}@users.noreply.github.com" | |
| git add . | |
| git commit -m "GalleryList.json Auto-Generate Job" | |
| git push | |
| # Page Deployment Job | |
| deploy: | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Artifacts | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| # Upload entire repository | |
| path: '.' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |