Skip to content

Commit 284c97f

Browse files
committed
Add Staging Environment
1 parent 08fd75b commit 284c97f

File tree

5 files changed

+47
-10
lines changed

5 files changed

+47
-10
lines changed

.github/workflows/gh-pages.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

config/_default/hugo.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
baseURL: https://cryptomator.org/
21
title: Cryptomator
32
defaultContentLanguage: en
43

config/development/params.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
baseURL: https://cryptomator.org/
2+
13
# API
24
baseApiUrl: http://localhost
35
storeApiUrl: http://localhost:8787/api

config/production/params.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
baseURL: https://cryptomator.org/
2+
13
# API
24
baseApiUrl: http://api.cryptomator.org
35
storeApiUrl: https://store.cryptomator.org/api

config/staging/params.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
baseURL: https://staging.cryptomator.org/
2+
13
# API
2-
baseApiUrl: http://localhost
3-
storeApiUrl: http://localhost:8787/api
4+
baseApiUrl: http://api.staging.cryptomator.cloud
5+
storeApiUrl: https://store.staging.cryptomator.org/
46

57
# UMAMI
68
umamiWebsiteId: 57a36f3a-bd97-4d8a-9563-0e8d39ddb20c

0 commit comments

Comments
 (0)