generated from wednesday-solutions/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.26 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
45
46
name: React Template CD
on:
push:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup git token
uses: fregante/setup-git-token@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: yarn
- name: Deploy storybooks and gh-pages
env:
DEPLOY_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${DEPLOY_KEY}"
yarn deploy
- 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: [email protected]
message: 'Update badges'
add: 'badges/'
push: false
- 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