-
-
Notifications
You must be signed in to change notification settings - Fork 28
71 lines (62 loc) · 1.91 KB
/
publish-examples.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish examples
on:
workflow_run:
workflows: ['Release']
branches: ['main']
types:
- completed
jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
project:
[
'react',
'next',
'vue',
'next-app',
'svelte',
'ngx',
'react-i18next',
'vue-i18next',
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: root
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Read last commit
id: get-commit-message
run: echo "COMMIT=$(git show -s --format=%s)" >> $GITHUB_OUTPUT
working-directory: root
- run: mkdir -p testapps/${{ matrix.project }}
- uses: actions/checkout@v3
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
repository: tolgee/${{ matrix.project }}-example
path: testapps/${{ matrix.project }}
- run: |
git rm -rf . && git clean -fxd
working-directory: testapps/${{ matrix.project }}
- run: |
rsync -av --progress root/testapps/${{ matrix.project }}/ \
testapps/${{ matrix.project }}/ \
--exclude 'package-lock.json'
- name: Recreate package-lock
run: |
npm install --package-lock-only --force
working-directory: testapps/${{ matrix.project }}
- name: Commit & Push files
run: |
git add .
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Automation Machine"
git commit -m "${{ steps.get-commit-message.outputs.COMMIT }} (published from monorepo)" -a || true
git push
working-directory: testapps/${{ matrix.project }}