@@ -31,26 +31,58 @@ jobs:
3131 npm ci --ignore-scripts
3232 env :
3333 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
3840 with :
41+ name : site
3942 path : ' public'
4043
41- # DEPLOY
42- deploy :
44+ # DEPLOY PROD
45+ deploy-prod :
4346 if : github.ref == 'refs/heads/main'
44- name : Deploy to GitHub Pages
47+ name : Deploy Prod to GitHub Pages
4548 runs-on : ubuntu-latest
4649 needs : [build]
4750 permissions : # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
4851 pages : write # to deploy to Pages
4952 id-token : write # to verify the deployment originates from an appropriate source
5053 steps :
54+ - name : Download build
55+ uses : actions/download-artifact@v4
56+ with :
57+ name : site
58+ path : ./public
5159 - name : Deploy to GitHub Pages
5260 id : deployment
5361 uses : actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
62+ with :
63+ path : ./public/prod
5464 environment : # Deploy to the github-pages environment
5565 name : github-pages
5666 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