@@ -17,26 +17,63 @@ jobs:
1717 runs-on : ubuntu-latest
1818 container :
1919 image : quay.io/rockylinux/rockylinux:9
20+ options : --user root
21+ outputs :
22+ DOCS_SHA : ${{steps.build.outputs.DOCS_SHA}}
2023 environment : production
2124 steps :
22- - name : Install deps
23- run : dnf -y install python3-pip npm git-core
24- - uses : actions/checkout@v4
25- - uses : actions/checkout@v4
25+ - name : Checkout mkdocs config
26+ uses : actions/checkout@v4
27+
28+ - name : " Build Site"
29+ uses : ./.github/actions/build-and-cache/
30+
31+ - name : set docs-sha
32+ id : docs-sha
33+ run : echo "$DOCS_SHA" >> "$GITHUB_OUTPUT"
34+ deploy :
35+ name : deploy
36+ needs : build
37+ runs-on : ubuntu-latest
38+ environment : production
39+ steps :
40+
41+ - uses : actions/cache/restore@v4
42+ id : docs-cache
2643 with :
27- repository : rocky-linux/documentation
28- path : docs
29- - run : python3.9 -m pip install -r requirements.txt
30- - name : Build Site
31- run : npm run build
32- - name : Archive build artifacts
33- uses : actions/upload-artifact@v4
44+ path : build/site/minified
45+ key : cache-docs-${{ needs.build.outputs.DOCS_SHA }}
46+ fail-on-cache-miss : false
47+ enableCrossOsArchive : true
48+
49+ - name : Retrieve build artifacts
50+ if : steps.docs-cache.outputs.cache-hit != 'true'
51+ uses : actions/download-artifact@v4
3452 with :
3553 name : build-minified
3654 path : |
3755 build/minified/site
38- - name : Deploy
56+
57+ - name : Set up Fastly CLI
58+ uses : fastly/compute-actions/setup@v6
59+ with :
60+ cli_version : ' latest'
61+ token : ${{ secrets.GITHUB_TOKEN }}
62+
63+ - name : Install Dependencies
64+ run : npm install
65+ working-directory : ./compute-js
66+
67+ - name : Build Compute Package
68+ uses : fastly/compute-actions/build@v6
69+ with :
70+ verbose : true
71+ project_directory : compute-js
72+
73+ - name : Deploy Compute Package
74+ uses : fastly/compute-actions/deploy@v6
75+ with :
76+ comment : ' Deployed via GitHub Actions'
77+ project_directory : compute-js
3978 env :
4079 FASTLY_API_TOKEN : ${{ secrets.FASTLY_API_TOKEN }}
41- FASTLY_SERVICE_ID : ${{ secrets.FASTLY_SERVICE_ID }}
42- run : npm run deploy
0 commit comments