-
Notifications
You must be signed in to change notification settings - Fork 44
82 lines (78 loc) · 2.16 KB
/
deploy.yml
File metadata and controls
82 lines (78 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy to GitHub Pages
on:
push:
branches: ["main", "develop"]
workflow_dispatch:
jobs:
# BUILD
build:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build production
run: npm run build
- name: Upload Prod Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: prod-site
path: './build'
- name: Build staging
run: npm run build
env:
SITE_URL: https://docs.staging.cryptomator.org
- name: Add robots.txt for staging
run: 'echo -e "User-agent: *\nDisallow: /" > build/robots.txt'
- name: Upload Staging artifact
uses: actions/upload-artifact@v4
with:
name: staging-site
path: './build'
# DEPLOY PROD
deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy Prod to GitHub Pages
runs-on: ubuntu-latest
needs: [build]
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: prod-site
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# DEPLOY STAGING
deploy-staging:
if: github.ref == 'refs/heads/develop'
name: Deploy Staging to GitHub Pages
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: staging-site
path: ./public
- name: Deploy to Staging Repository
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.CRYPTOBOT_DEPLOY_STAGING_DOCS }}
external_repository: cryptomator/docs-staging
publish_dir: ./public
publish_branch: main
cname: docs.staging.cryptomator.org