Software page gwct (#3) #18
This file contains 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
# Build site for commits pushed to all branches | |
# Deploy only if on default branch | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9.x' # same as macOS | |
cache: pip | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Build site | |
run: mkdocs build | |
- name: Upload site/ | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: site | |
deploy: | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |