-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.36 KB
/
update-client.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
47
48
49
50
name: Update API client
on:
workflow_dispatch:
schedule:
- cron: "0 19 * * *"
jobs:
update-client:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_PAT: ${{ secrets.PUBLISH_PAT }}
GH_TOKEN: ${{ secrets.PUBLISH_PAT }}
steps:
- name: Checkout ⬇️
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PUBLISH_PAT }}
- name: Git Identity 🪪
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Yarn Install 📦️
run: yarn install --immutable
- name: Setup NX 1/2 🎛️
uses: nrwl/nx-set-shas@v4
- name: Setup NX 2/2 🎛
if: github.ref != 'refs/heads/master'
run: git branch --track master origin/master
- name: Update OpenAPI ⬇️
if: github.ref == 'refs/heads/master'
run: |
yarn nx run @mittwald/api-client:build:fetch-openapi-prod
if [ $(git status --porcelain . | wc -l) -gt 0 ] ; then
yarn nx run @mittwald/api-client:build:client-prod
git add .
yarn test
git commit -m "feat: update generated client";
git push origin
fi