-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (71 loc) · 2.86 KB
/
auto-updates.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
75
76
77
78
79
80
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@v3
with:
ref: master
fetch-depth: 10
token: ${{ secrets.GH_PAT }}
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.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@v2
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@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: lightswitch05
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: lightswitch05
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: ./
platforms: linux/amd64, linux/arm64
build-args: |
NODE_IMAGE_TAG=18
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