forked from dan5py/turborepo-shadcn-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (48 loc) · 1.69 KB
/
update-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
name: Update Dependencies
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
update-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Volta
run: |
curl https://get.volta.sh | bash
echo "$HOME/.volta/bin" >> $GITHUB_PATH
- name: Install Node.js with Volta
run: volta install node
- name: Set PNPM version
run: |
echo "PNPM_VERSION=$(jq -r '.packageManager' package.json | awk -F'@' '{print $2}')" >> $GITHUB_ENV
- name: Install pnpm using Volta
run: volta install pnpm@${{ env.PNPM_VERSION }}
- name: Get pnpm store directory
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile --strict-peer-dependencies
- name: Update dependencies
run: pnpm up -r --latest '!*eslint*'
- name: Build
run: pnpm build
- name: Commit and push changes
if: success()
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git diff-index --quiet HEAD || git commit -m "chore: update dependencies"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}