-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.28 KB
/
deploy.yaml
File metadata and controls
64 lines (51 loc) · 1.28 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
name: Deploy React to GitHub Pages
on:
push:
branches:
- main
paths-ignore:
- README.md
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# ✅ Attach environment HERE
environment:
name: github-pages
steps:
- name: Get code
uses: actions/checkout@v4
- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm install
- name: Build Project
run: npm run build
env:
VITE_API_URL: ${{ vars.VITE_API_URL }}
- name: Upload dist artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
steps:
- name: Deploy to Github pages
id: deployment
uses: actions/deploy-pages@v4
- name: Show Deployed URL
run: echo "Deployed at ${{ steps.deployment.outputs.page_url }}"