rebuild_pages #1027
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
repository_dispatch: | |
types: | |
- rebuild_pages | |
env: | |
GO_VERSION: "1.21" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
name: "Linting" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: run linters | |
run: make lint | |
test: | |
runs-on: ubuntu-latest | |
name: "Test" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: run tests | |
run: make test | |
build: | |
name: generate pages | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- run: make generate | |
env: | |
VERSION: ${{ github.ref_name }} | |
SOURCE_URL: https://github.com/${{ github.repository }}/tree/${{ github.sha }} | |
- name: upload generated pages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: go.anx.io | |
path: public/ | |
deploy: | |
name: deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_name == 'main' }} | |
needs: | |
- build | |
- test | |
steps: | |
# - uses: actions/deploy-pages@v1-beta | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: go.anx.io | |
path: public | |
- name: deploy to github pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
cname: go.anx.io | |
force_orphan: true |