-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (79 loc) · 1.99 KB
/
web.yml
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
name: Build and Deploy Website
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
- '.api/**'
pull_request:
branches:
- main
paths-ignore:
- '.github/**'
- '.api/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: NPM Install Dependencies
run: npm ci
- name: NPM Build Docusaurus Website
run: npm run build
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: website
path: build
deploy-github-pages:
needs: build
environment:
name: GitHub-Pages
url: https://github.dsanchezcr.com
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: website
path: build
- name: Upload GitHub Page artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
deploy-azure:
runs-on: ubuntu-latest
needs: deploy-github-pages
if: github.ref == 'refs/heads/main'
environment:
name: Production
url: https://dsanchezcr.com
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: website
path: build
- name: Deploy to Azure Static Web Apps
uses: azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
app_location: 'build'
api_location: './api'
output_location: 'build'