auto-update #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update npm dependencies | |
on: | |
schedule: | |
- cron: '30 12 4,18 * *' | |
workflow_dispatch: | |
jobs: | |
update-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Update npm dependencies | |
run: | | |
npm version patch --no-git-tag-version | |
npm update | |
npm run build | |
npm run test --if-present | |
- name: Create Private Key for SSH | |
run: | | |
touch /tmp/github-actions-bot | |
chmod 600 /tmp/github-actions-bot | |
echo "${{ secrets.REPO_DEPLOY_KEY }}" > /tmp/github-actions-bot | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@v9 | |
env: | |
GIT_SSH_COMMAND: "ssh -i /tmp/github-actions-bot -o StrictHostKeyChecking=no" | |
with: | |
add: 'package*.json' | |
author_name: 'github-actions[bot]' | |
author_email: 'github-actions[bot]@users.noreply.github.com' | |
fetch: false | |
message: 'Npm deps update' | |
pathspec_error_handling: exitImmediately | |
pull: '--rebase --autostash' | |
- name: Cleanup | |
run: | | |
unset REPO_DEPLOY_KEY | |
rm -rf /tmp/* |