-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.3 KB
/
main.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
name: ci
on:
schedule:
# build every first of the month
- cron: '0 0 1 * *'
push:
pull_request:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [ 16, 17, 18, 19, 20, 21, 22 ]
distroAddon: [ '', '-alpine' ]
include:
- node: 20
distroAddon: ''
additionalTags: "ghcr.io/pluswerk/node-dev:lts,pluswerk/node-dev:lts,"
- node: 20
distroAddon: '-alpine'
additionalTags: "ghcr.io/pluswerk/node-dev:lts-alpine,pluswerk/node-dev:lts-alpine,"
- node: 22
distroAddon: ''
additionalTags: "ghcr.io/pluswerk/node-dev:latest,ghcr.io/pluswerk/node-dev:current,pluswerk/node-dev:latest,pluswerk/node-dev:current,"
- node: 22
distroAddon: '-alpine'
additionalTags: "ghcr.io/pluswerk/node-dev:latest-alpine,ghcr.io/pluswerk/node-dev:current-alpine,pluswerk/node-dev:latest-alpine,pluswerk/node-dev:current-alpine,"
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push ${{ matrix.node }}
id: docker_build
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ matrix.additionalTags }}ghcr.io/pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }},pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }}
build-args: |
FROM=node:${{ matrix.node }}${{ matrix.distroAddon }}
DIST_ADDON=${{ matrix.distroAddon }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
-
name: Image digest
run: |
echo ${{ steps.docker_build.outputs.digest }}
echo ${{ steps.docker_build_dev.outputs.digest }}