Repository navigation
CI: run once per change, and skip documentation-only changes (#8) #15
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| # The template itself has no Pages site, and should not: it exists to be | |
| # copied, not published. Without this guard every push here failed with | |
| # "Get Pages site failed. Please verify that the repository has Pages | |
| # enabled", which is not a fault a template can fix about itself. | |
| # | |
| # Repositories generated from the template have a different name, so the | |
| # deploy runs there exactly as intended -- which is the whole point of | |
| # shipping this file. | |
| if: github.repository != 'PyDevices/pyscript-template' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Vendor PyScript | |
| run: ./scripts/vendor_pyscript.sh | |
| - name: Stamp service worker cache version | |
| run: sed -i "s/__DEPLOY_VERSION__/${GITHUB_SHA}/" sw.js | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: . | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |