Skip to content

Upgrade dependencies #2

Upgrade dependencies

Upgrade dependencies #2

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