generated from anexia-it/open-source-template
-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (73 loc) · 1.65 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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