Skip to content

Commit 9c580a9

Browse files
committed
feat(docker): trigger docker multiarch build
1 parent ed203f6 commit 9c580a9

File tree

3 files changed

+39
-26
lines changed

3 files changed

+39
-26
lines changed

.github/workflows/_test.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Unit Tests
2+
on: workflow_call
3+
jobs:
4+
unit-tests:
5+
runs-on: '${{ matrix.os }}'
6+
strategy:
7+
matrix:
8+
os:
9+
- ${{ vars.UBUNTU_VERSION }}
10+
node-version:
11+
- 12.x
12+
- 14.x
13+
- 16.x
14+
- 18.x
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: 'Install node.js ${{ matrix.node-version }}'
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '${{ matrix.node-version }}'
21+
- name: Run unit tests
22+
run: |
23+
npm install
24+
npm run ci

.github/workflows/pull_request.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: Continuous Integration
2+
on: pull_request
3+
jobs:
4+
unit-tests:
5+
# only run this job for forks
6+
if: github.event.pull_request.head.repo.full_name != github.repository
7+
uses: ./.github/workflows/_test.yml

.github/workflows/push.yml

+8-26
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,17 @@ name: Continuous Integration
22
on: push
33
jobs:
44
unit-tests:
5-
runs-on: '${{ matrix.os }}'
6-
strategy:
7-
matrix:
8-
os:
9-
- ubuntu-20.04
10-
node-version:
11-
- 12.x
12-
- 14.x
13-
- 16.x
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: 'Install node.js ${{ matrix.node-version }}'
17-
uses: actions/setup-node@v2-beta
18-
with:
19-
node-version: '${{ matrix.node-version }}'
20-
- name: Run unit tests
21-
run: |
22-
npm install
23-
npm run ci
5+
uses: ./.github/workflows/_test.yml
246
npm-publish:
257
needs: unit-tests
26-
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
27-
runs-on: ubuntu-20.04
8+
if: github.ref == 'refs/heads/master' && needs.unit-tests.result == 'success'
9+
runs-on: ${{ vars.UBUNTU_VERSION }}
2810
steps:
29-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
3012
- name: Install Node.js
31-
uses: actions/setup-node@v2-beta
13+
uses: actions/setup-node@v4
3214
with:
33-
node-version: 16.x
15+
node-version: 20.x
3416
- name: Run semantic-release
3517
env:
3618
GH_TOKEN: ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }}
@@ -44,9 +26,9 @@ jobs:
4426
# note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
4527
if: ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
4628
needs: [unit-tests, npm-publish]
47-
runs-on: ubuntu-20.04
29+
runs-on: ${{ vars.UBUNTU_VERSION }}
4830
steps:
49-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
5032
- name: Build Docker images
5133
env:
5234
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}

0 commit comments

Comments
 (0)