generated from itsjavi/template-react-component-library
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (58 loc) · 1.79 KB
/
upgrade-dependencies.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
72
73
74
name: Upgrade dependencies
on:
schedule:
- cron: '0 5 * * 1'
workflow_dispatch:
jobs:
upgradeDependencies:
name: 'Upgrade dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup Project'
uses: ./.github/actions/setup-project
- name: 'Upgrade dependencies'
run: pnpm run upgrade-deps
- name: 'Check and fix code style'
run: pnpm lint:fix
- name: 'Check code quality'
uses: ./.github/actions/check-code-quality
- name: 'Prepare artifact'
run: tar -czf /tmp/package.tar.gz package.json pnpm-lock.yaml node_modules
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: workspace
path: /tmp/package.tar.gz
retention-days: 1
pushUpgrade:
name: 'Push upgrade to git'
needs: [upgradeDependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: workspace
path: /tmp
- name: 'Extract artifact'
run: tar -xf /tmp/package.tar.gz -C .
- name: 'Setup Project'
uses: ./.github/actions/setup-project
- name: 'Check and fix code style'
run: pnpm lint:fix
- name: 'Check code quality'
uses: ./.github/actions/check-code-quality
- name: 'Prepare git'
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git branch -u origin/main main
- name: 'Push to git'
run: |
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "chore: upgrade dependencies"
git push
fi