Skip to content

chore: modernize GitHub Actions workflows (#6) #11

chore: modernize GitHub Actions workflows (#6)

chore: modernize GitHub Actions workflows (#6) #11

Workflow file for this run

name: Docker
on:
push:
branches: [master]
permissions:
contents: read
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: v6
- image: v7
- image: v8
- image: v9
- image: v10
- image: v11
- image: v12
- image: v13
- image: v14
- image: v15
- image: v16
- image: v17
- image: v18
fail-fast: false
name: Docker (dockette/nodejs:${{ matrix.image }})
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image }}
push: false
tags: dockette/nodejs:${{ matrix.image }}
platforms: linux/amd64,linux/arm64
- name: Load docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image }}
load: true
tags: dockette/nodejs:${{ matrix.image }}
- name: Test node version
run: |
var="$(docker run --rm dockette/nodejs:${{ matrix.image }} node -v)"
if [[ $var =~ "${{ matrix.image }}" ]]; then
echo "Node version matched ${var} =~ ${{ matrix.image }}"
else
echo "Invalid node version ${var} != ${{ matrix.image }}"
exit 255
fi
- name: Push docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.image }}
push: true
tags: dockette/nodejs:${{ matrix.image }}
platforms: linux/amd64,linux/arm64