This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.14 KB
/
izettle-products-docs.yaml
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
name: Izettle Products Docs
on:
push:
paths:
- 'products/izettle/app/package.json'
- 'products/izettle/app/.nvmrc'
- 'products/izettle/app/.env.sample'
- 'products/izettle/chart/keystone-cms/Chart.yaml'
- 'products/izettle/chart/keystone-cms/values.yaml'
defaults:
run:
shell: bash
working-directory: 'products/izettle/'
env:
GIT_UPSTREAM: origin
GIT_USERNAME: Bot
GIT_EMAIL: [email protected]
GH_ACTOR: cowlingj-bot
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- uses: actions/cache@v1
env:
cache-name: cache-yeoman-node-modules
hash: libraries/generator-ecommerce-backend/package-lock.json
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles(env.hash) }}
- run: npm install --global yo @cowlingj/generator-ecommerce-backend-service
- run: yo @cowlingj/ecommerce-backend-service:docs --config
- name: check if docs different
id: diff
run: |-
git add --intent-to-add ./docs/
if git diff --summary --exit-code ./docs/; then
echo "::set-output name=diff::false"
else
echo "::set-output name=diff::true"
fi
- uses: oleksiyrudenko/gha-git-credentials@v1
if: steps.diff.outputs.diff == 'true'
with:
name: '${{ env.GIT_USERNAME }}'
email: '${{ env.GIT_EMAIL }}'
actor: '${{ env.GH_ACTOR }}'
token: '${{ secrets.GH_TOKEN }}'
- name: commit diff
if: steps.diff.outputs.diff == 'true'
run: |-
git add ./docs/
git commit -m "#ci update docs [ci skip]"
- uses: nick-invision/retry@v1
if: steps.diff.outputs.diff == 'true'
with:
timeout_minutes: 5
max_attempts: 3
command: |-
git fetch ${{ github.head_ref }}
git pull "${GIT_UPSTREAM}" "${GITHUB_REF#refs/heads/}"
git push "${GIT_UPSTREAM}" "${GITHUB_REF#refs/heads/}"