-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (63 loc) · 2.02 KB
/
dockerimage.yml
File metadata and controls
77 lines (63 loc) · 2.02 KB
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
name: Docker Image Testing
on:
pull_request:
paths:
- "Dockerfile"
- "build.sh"
- ".github/workflows/dockerimage.yml"
env:
IMAGE_NAME: node-minimal
jobs:
build:
strategy:
matrix:
os:
- ubuntu-24.04
- ubuntu-24.04-arm
platform:
- amd64
- arm64
exclude:
- os: ubuntu-24.04
platform: arm64
- os: ubuntu-24.04-arm
platform: amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.22
with:
key: ${{ matrix.os }}-${{ matrix.platform }}
max-size: 10G
- name: Configure ccache
run: |
ccache --set-config=sloppiness=time_macros,locale,include_file_ctime,include_file_mtime
ccache --set-config=hash_dir=false
ccache -p
- name: Get latest node version
run: echo "LATEST_VERSION=$(curl -fsSLo- --compressed https://nodejs.org/dist/index.json | jq '.[].version' | tr -d '"' | tr -d 'v' | head -1)" >> $GITHUB_ENV
- name: Display Node Version
run: |
echo "Building Node.js version: $LATEST_VERSION"
- name: Build Node
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
which gcc
./build.sh -n $LATEST_VERSION
ccache -s
cp node-v$LATEST_VERSION/out/Release/node node
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build Image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/${{ matrix.platform }}
load: true
tags: ${{ env.IMAGE_NAME }}-${{ env.LATEST_VERSION }}
- name: Test Image
run: docker run --rm ${{ env.IMAGE_NAME }}-${{ env.LATEST_VERSION }} -e "console.log('Hello from Node.js ' + process.version)"