@@ -31,26 +31,58 @@ jobs:
31
31
npm ci --ignore-scripts
32
32
env :
33
33
NODE_AUTH_TOKEN : ${{ secrets.FONTAWESOME_AUTH_TOKEN }}
34
- - name : Build
35
- run : hugo --minify
36
- - name : Upload artifact
37
- uses : actions/upload-pages-artifact@v3
34
+ - name : Build production
35
+ run : hugo --minify --destination public/prod
36
+ - name : Build staging
37
+ run : hugo --environment=staging --minify --destination public/staging
38
+ - name : Upload artifacts
39
+ uses : actions/upload-artifact@v4
38
40
with :
41
+ name : site
39
42
path : ' public'
40
43
41
- # DEPLOY
42
- deploy :
44
+ # DEPLOY PROD
45
+ deploy-prod :
43
46
if : github.ref == 'refs/heads/main'
44
- name : Deploy to GitHub Pages
47
+ name : Deploy Prod to GitHub Pages
45
48
runs-on : ubuntu-latest
46
49
needs : [build]
47
50
permissions : # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
48
51
pages : write # to deploy to Pages
49
52
id-token : write # to verify the deployment originates from an appropriate source
50
53
steps :
54
+ - name : Download build
55
+ uses : actions/download-artifact@v4
56
+ with :
57
+ name : site
58
+ path : ./public
51
59
- name : Deploy to GitHub Pages
52
60
id : deployment
53
61
uses : actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
62
+ with :
63
+ path : ./public/prod
54
64
environment : # Deploy to the github-pages environment
55
65
name : github-pages
56
66
url : ${{ steps.deployment.outputs.page_url }}
67
+
68
+ # DEPLOY STAGING
69
+ deploy-staging :
70
+ if : github.ref == 'refs/heads/develop'
71
+ name : Deploy Staging to GitHub Pages
72
+ runs-on : ubuntu-latest
73
+ needs : [build]
74
+ steps :
75
+ - name : Download build
76
+ uses : actions/download-artifact@v4
77
+ with :
78
+ name : site
79
+ path : ./public
80
+ - name : Deploy to Staging Repository
81
+ uses : peaceiris/actions-gh-pages@v3
82
+ with :
83
+ deploy_key : ${{ secrets.GITHUB_TOKEN }}
84
+ external_repository : cryptomator/staging.cryptomator.org
85
+ publish_dir : ./public/staging
86
+ publish_branch : main
87
+ cname : staging.cryptomator.org
88
+
0 commit comments