File tree Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy Astro Application to Github Pages
2
+ on :
3
+ push :
4
+ branches : [ "main" ]
5
+ pull_request :
6
+ branches : [ "main" ]
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch :
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12
+ permissions :
13
+ contents : read
14
+ pages : write
15
+ id-token : write
16
+
17
+ # Allow one concurrent deployment
18
+ concurrency :
19
+ group : " pages"
20
+ cancel-in-progress : true
21
+
22
+ jobs :
23
+ build :
24
+ runs-on : ubuntu-latest
25
+
26
+ environment :
27
+ name : github-pages
28
+ url : ${{ steps.deployment.outputs.page_url }}
29
+
30
+ steps :
31
+ - name : Checkout
32
+ uses : actions/checkout@v3
33
+
34
+ - name : Setup Node.js 20
35
+ uses : actions/setup-node@v3
36
+ with :
37
+ node-version : 20.0
38
+
39
+ - uses : pnpm/action-setup@v2
40
+ name : Install pnpm
41
+ id : pnpm-install
42
+ with :
43
+ version : 8
44
+ run_install : false
45
+
46
+ - name : Get pnpm store directory
47
+ id : pnpm-cache
48
+ shell : bash
49
+ run : |
50
+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
51
+
52
+ - uses : actions/cache@v3
53
+ name : Setup pnpm cache
54
+ with :
55
+ path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
56
+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
57
+ restore-keys : |
58
+ ${{ runner.os }}-pnpm-store-
59
+
60
+ - name : Install dependencies
61
+ run : pnpm install
62
+
63
+ - name : Build via pnpm run build
64
+ run : pnpm run build
65
+
66
+ - name : Setup Pages
67
+ uses : actions/configure-pages@v2
68
+
69
+ - name : Upload artifact
70
+ uses : actions/upload-pages-artifact@v1
71
+ with :
72
+ path : ' ./dist/'
73
+
74
+ - name : Deploy to GitHub Pages
75
+ id : deployment
76
+ uses : actions/deploy-pages@v1
You can’t perform that action at this time.
0 commit comments