Update workflow for versioning and introduce version.txt #7
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 GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Prepare site artifact | |
| run: | | |
| set -euo pipefail | |
| rm -rf dist | |
| mkdir -p dist | |
| cp index.html dist/ | |
| [ -f favicon.ico ] && cp favicon.ico dist/ | |
| [ -f company_logo.png ] && cp company_logo.png dist/ | |
| [ -f version.txt ] && cp version.txt dist/ | |
| shopt -s nullglob | |
| for file in ttn_decoder-*.js; do | |
| cp "$file" dist/ | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| - name: Deploy to GitHub Pages | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |