1
- # Simple workflow for deploying static content to GitHub Pages
2
- name : Deploy static content to Pages
1
+ name : Deploy to Pages
3
2
4
3
on :
5
4
# Runs on pushes targeting the default branch
@@ -21,23 +20,58 @@ concurrency:
21
20
group : " pages"
22
21
cancel-in-progress : false
23
22
23
+ # Default to bash
24
+ defaults :
25
+ run :
26
+ shell : bash
27
+
24
28
jobs :
25
- # Single deploy job since we're just deploying
26
- deploy :
27
- environment :
28
- name : github-pages
29
- url : ${{ steps.deployment.outputs.page_url }}
29
+ # Build job
30
+ build :
30
31
runs-on : ubuntu-latest
31
32
steps :
32
33
- name : Checkout
33
- uses : actions/checkout@v4
34
+ uses : actions/checkout@v3
35
+ - name : Detect package manager
36
+ id : detect-package-manager
37
+ run : |
38
+ if [ -f "${{ github.workspace }}/yarn.lock" ]; then
39
+ echo "manager=yarn" >> $GITHUB_OUTPUT
40
+ echo "command=install" >> $GITHUB_OUTPUT
41
+ exit 0
42
+ elif [ -f "${{ github.workspace }}/package.json" ]; then
43
+ echo "manager=npm" >> $GITHUB_OUTPUT
44
+ echo "command=ci" >> $GITHUB_OUTPUT
45
+ exit 0
46
+ else
47
+ echo "Unable to determine package manager"
48
+ exit 1
49
+ fi
50
+ - name : Setup Node
51
+ uses : actions/setup-node@v3
52
+ with :
53
+ node-version : " 18"
54
+ cache : ${{ steps.detect-package-manager.outputs.manager }}
34
55
- name : Setup Pages
35
- uses : actions/configure-pages@v5
56
+ id : pages
57
+ uses : actions/configure-pages@v3
58
+ - name : Install dependencies
59
+ run : ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
60
+ - name : Build
61
+ run : ${{ steps.detect-package-manager.outputs.manager }} run build
36
62
- name : Upload artifact
37
- uses : actions/upload-pages-artifact@v3
63
+ uses : actions/upload-pages-artifact@v1
38
64
with :
39
- # Upload entire repository
40
- path : ' .'
65
+ path : ./docs
66
+
67
+ # Deployment job
68
+ deploy :
69
+ environment :
70
+ name : github-pages
71
+ url : ${{ steps.deployment.outputs.page_url }}
72
+ runs-on : ubuntu-latest
73
+ needs : build
74
+ steps :
41
75
- name : Deploy to GitHub Pages
42
76
id : deployment
43
- uses : actions/deploy-pages@v4
77
+ uses : actions/deploy-pages@v2
0 commit comments