-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathcd.yml
More file actions
59 lines (54 loc) · 1.44 KB
/
cd.yml
File metadata and controls
59 lines (54 loc) · 1.44 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
# CD workflow for React app
name: React App CD
on:
push:
branches:
- main
- releases/*
env:
owner: fill_User_or_Org_name
domain: github.io
jobs:
deploy-dev-test:
name: Deploy to Dev test environment
runs-on: ubuntu-latest
environment:
name: DevTest
url: https://${{ env.owner }}.${{ env.domain }}/${{ env.repo }}//
env:
repo: ci-cd-with-actions
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Install and Build
run: |
npm install
npm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
deploy-prod:
name: Deploy to Production environment
needs: [deploy-dev-test]
runs-on: ubuntu-latest
environment:
name: Production
url: https://${{ env.owner }}.${{ env.domain }}/${{ env.repo }}//
env:
repo: actions-workshop-prod
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Install and Build
run: |
npm install
npm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: gh-pages
folder: build
token: ${{ secrets.TOKEN }}
repository-name: ${{ env.owner }}/${{ env.repo }}