@@ -4,61 +4,136 @@ name: "Blog"
44on :
55 push :
66 branches :
7- - master
87 - main
8+ - ci-testing*
9+
10+ pull_request :
11+ branches :
12+ - main
13+ - ci-testing*
914
1015jobs :
11- deploy :
12- # These permissions are needed to interact with GitHub's OIDC Token endpoint.
16+ build :
1317 permissions :
14- id-token : write
1518 contents : read
16-
1719 runs-on : ubuntu-latest
1820
1921 steps :
2022 - uses : actions/checkout@v4
21- - uses : extractions/setup-just@v1
22-
23- - name : Configure AWS Credentials
24- uses : aws-actions/configure-aws-credentials@v2
2523 with :
26- aws-region : us-west-2
27- role-to-assume : arn:aws:iam::984616268605:role/ideas-deployer
28- role-session-name : deploy-ideas
29- mask-aws-account-id : false
24+ persist-credentials : false
3025
31- - name : Set up uv
32- run : |
33- curl -LsSf https://astral.sh/uv/0.4.22/install.sh | sh
34- - name : Set up Python
35- run : |
36- uv python install --python-preference=system
37-
38- - name : install python libs
39- run : uv sync
40-
41- - name : Set up Node
42- uses : actions/setup-node@v3
26+ - name : Install just
27+ uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
28+ - name : Install uv
29+ uses : astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v6.4.1
30+ - name : Install node
31+ uses : actions/setup-node@v4.4.0
4332 with :
44- node-version : " 18 "
45-
33+ node-version-file : .tool-versions
34+ cache : npm
4635 - name : Install dependencies
47- run : |
48- npm install
49- echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH"
36+ run : just setup-gha
5037
5138 - name : Assert that our dependencies are reachable
5239 run : |
5340 uv run python --version
5441 uv run pelican --version
5542 sass --version
56- just --version
5743
5844 - name : Build the page
5945 run : |
6046 just generate
6147
48+ - name : Upload build artifact
49+ uses : actions/upload-artifact@v4
50+ with :
51+ name : site-build
52+ path : output/
53+ retention-days : 1
54+
55+ verify :
56+ needs : build
57+ runs-on : ubuntu-latest
58+ permissions :
59+ contents : read
60+ strategy :
61+ matrix :
62+ check :
63+ - check-links
64+ - check-html
65+ - check-code
66+ - check-content
67+ - check-feeds
68+ steps :
69+ - uses : actions/checkout@v4
70+ with :
71+ persist-credentials : false
72+ - name : Install just
73+ uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
74+ - name : Install uv
75+ uses : astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v6.4.1
76+ - name : Install node
77+ uses : actions/setup-node@v4.4.0
78+ with :
79+ node-version-file : .tool-versions
80+ cache : npm
81+ - name : Install dependencies
82+ run : just setup-gha
83+ - name : Download build artifact
84+ uses : actions/download-artifact@v4
85+ with :
86+ name : site-build
87+ path : output/
88+
89+ - name : Run verification checks
90+ run : just ${{ matrix.check }}
91+
92+ deploy :
93+ # I am not blocking this on verify because I want the ability to publish
94+ # quick trash.
95+ needs : build
96+ # only run this when the action is push and the destination branch is main
97+ if : github.action == 'push' && github.ref_name == 'main'
98+ permissions :
99+ id-token : write
100+ contents : read
101+ runs-on : ubuntu-latest
102+
103+ steps :
104+ - uses : actions/checkout@v4
105+ with :
106+ persist-credentials : false
107+ sparse-checkout : |
108+ justfile
109+ sparse-checkout-cone-mode : false
110+
111+ - name : Install just
112+ uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
113+ - name : Install uv
114+ uses : astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v6.4.1
115+ - name : Install node
116+ uses : actions/setup-node@v4.4.0
117+ with :
118+ node-version-file : .tool-versions
119+ cache : npm
120+ - name : Install dependencies
121+ run : just setup-gha
122+
123+ - name : Configure AWS Credentials
124+ uses : aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
125+ with :
126+ aws-region : us-west-2
127+ role-to-assume : arn:aws:iam::984616268605:role/ideas-deployer
128+ role-session-name : deploy-ideas
129+ mask-aws-account-id : false
130+
131+ - name : Download build artifact
132+ uses : actions/download-artifact@v4
133+ with :
134+ name : site-build
135+ path : output/
136+
62137 - name : Publish the content
63138 run : |
64139 just upload
69144
70145 - name : Tell me about it
71146 if : ${{ always() }}
72- uses : desiderati/github-action-pushover@v1
147+ uses : desiderati/github-action-pushover@22efda5223198aba3e271f9cbec9b1b3a16033b0 # v1
73148 with :
74149 job-status : ${{ job.status }}
75150 pushover-api-token : ${{ secrets.PUSHOVER_API_TOKEN }}
0 commit comments