-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (40 loc) · 1.14 KB
/
cd.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
name: React Template CD
on:
push:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: yarn
- name: Build storybooks and react
run: yarn predeploy
- name: Deploy gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
- name: Set branch name
id: vars
run: echo ::set-output name=stage::${GITHUB_REF#refs/*/}
- name: Create badges
run: yarn run test:badges
- name: Commit badges
uses: EndBug/add-and-commit@v7
with:
author_name: Gitflow
author_email: git@wednesday.is
message: 'Update badges'
add: 'badges/'
push: false
- name: Git pull origin
run: |
git pull origin ${{ github.ref }}
- name: Pushing to a protected branch
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
branch: ${{ steps.vars.outputs.stage }}
unprotect_reviews: true