File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : SpechtLabs Static-Pages deploy
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches : [main]
7
+
8
+ permissions :
9
+ id-token : write
10
+
11
+ jobs :
12
+ deploy :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Git checkout
16
+ uses : actions/checkout@v3
17
+ with :
18
+ submodules : recursive # fetch Hugo themes
19
+ fetch-depth : 0
20
+
21
+ - name : Init submodules
22
+ run : git submodule update --init --recursive
23
+
24
+ - uses : actions/cache@v3
25
+ with :
26
+ path : /tmp/hugo_cache
27
+ key : ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
28
+ restore-keys : |
29
+ ${{ runner.os }}-hugomod-
30
+
31
+ - name : Setup hugo
32
+ uses : peaceiris/actions-hugo@v2
33
+ with :
34
+ hugo-version : " latest"
35
+ extended : true
36
+
37
+ - name : Build
38
+ # remove --minify tag if you do not need it
39
+ # docs: https://gohugo.io/hugo-pipes/minification/
40
+ run : hugo --minify
41
+
42
+ - name : Upload static site artifacts
43
+ shell : bash
44
+ run : |
45
+ # Fetch GitHub OIDC token
46
+ TOKEN=$(curl -sSfL -X POST \
47
+ -H "Authorization: bearer $ACTIONS_RUNTIME_TOKEN" \
48
+ -H "Accept: application/json; api-version=2.0" \
49
+ "https://github.com/api/actions/oidc/token?audience=your-api" \
50
+ | jq -r '.value')
51
+
52
+ # Prepare curl arguments
53
+ CURL_ARGS=()
54
+ for file in dist/*; do
55
+ [ -f "$file" ] || continue
56
+ CURL_ARGS+=("-F" "files[]=@${file}")
57
+ done
58
+
59
+ # Upload to your REST API
60
+ curl -X POST https://static-pages.sphinx-map.ts.net/upload \
61
+ -H "Authorization: Bearer $TOKEN" \
62
+ "${CURL_ARGS[@]}"
You can’t perform that action at this time.
0 commit comments