Skip to content

Publish Node.js container images based on Ubuntu #107

Publish Node.js container images based on Ubuntu

Publish Node.js container images based on Ubuntu #107

name: Publish Node.js container images based on Ubuntu
on:
schedule:
- cron: '0 17 * * 2'
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{github.repository_owner}}/node
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14]
ubuntu: [impish]
permissions:
packages: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[worker.oci]
max-parallelism = 1
- name: Log into registry ${{env.REGISTRY}}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}
tags: |
type=raw,${{matrix.node}}-${{matrix.ubuntu}}
labels: |
org.opencontainers.image.title=Node.js ${{matrix.node}} container image based on Ubuntu ${{matrix.ubuntu}}
org.opencontainers.image.description=Node.js ${{matrix.node}} container image based on Ubuntu ${{matrix.ubuntu}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: '{{defaultContext}}:node/${{matrix.node}}/${{matrix.ubuntu}}'
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/s390x
push: ${{github.event_name != 'pull_request'}}
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}