This repository was archived by the owner on Sep 21, 2025. It is now read-only.
Auto Updates #2516
This file contains hidden or 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: Auto Updates | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '5 1 * * *' | |
| - cron: '5 13 * * *' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_PAT }} | |
| jobs: | |
| run-updates: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| fetch-depth: 10 | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Change origin to bypass gh-pages issues with actions | |
| run: git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/lightswitch05/node-version-audit.git | |
| - name: Ensure latest commit with tags | |
| run: git fetch; git fetch --tags --all; git checkout master; git pull | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Cache downloaded files | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/tmp | |
| key: ${{ runner.os }}-node-version-audit-${{ hashFiles('**/docs/rules-v1.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-version-audit- | |
| - run: npm run test:unit | |
| - run: ./bin/node-version-audit --full-update --no-update --vvv | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: | | |
| ./scripts/bump-version.sh | |
| npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: ./scripts/github-commit-auto-updates.sh | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: lightswitch05 | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: lightswitch05 | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| pull: true | |
| cache-from: type=registry,ref=lightswitch05/node-version-audit:latest-cache | |
| cache-to: type=registry,ref=lightswitch05/node-version-audit:latest-cache,mode=max | |
| context: ./ | |
| platforms: linux/amd64, linux/arm64 | |
| build-args: | | |
| NODE_IMAGE_TAG=22 | |
| file: ./docker/Dockerfile | |
| tags: | | |
| lightswitch05/node-version-audit:latest | |
| lightswitch05/node-version-audit:1 | |
| ghcr.io/lightswitch05/node-version-audit:latest | |
| ghcr.io/lightswitch05/node-version-audit:1 |