Release v0.1.0 #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: Build, Deploy GitHub Pages, Create Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.pkg.outputs.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install and Build | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Read version from package.json | |
| id: pkg | |
| shell: bash | |
| run: | | |
| VERSION="$(node -p "require('./package.json').version")" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./dist | |
| - name: Upload dist artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist | |
| if-no-files-found: error | |
| deploy_pages: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| env: | |
| VERSION: ${{ needs.build.outputs.version }} | |
| steps: | |
| - name: Download dist artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Package dist as zip | |
| shell: bash | |
| run: | | |
| cd dist | |
| zip -r ../VETO-v${VERSION}.zip . | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| name: VETO v${{ env.VERSION }} | |
| files: VETO-v${{ env.VERSION }}.zip | |
| generate_release_notes: true |