Allow manual trigger for deploy action #82
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: Generate, Upload, Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # Checkout repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Set up Node environment | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| # Install Node dependencies | |
| - name: Install Node dependencies | |
| run: | | |
| npm install | |
| # Run Node script | |
| - name: Run Node script | |
| run: | | |
| node matf.js | |
| # Commit changes | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: Add generated index.html | |
| - name: Run spec-prod | |
| uses: w3c/spec-prod@v2 | |
| upload: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download spec-prod artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: spec-prod-result | |
| path: _site | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: upload | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |