Skip to content

v2.5.5

v2.5.5 #147

---
name: Publish Node Image
'on':
workflow_dispatch:
inputs:
tag_latest:
description: "Also tag this build as latest"
type: boolean
default: false
release:
types:
- published
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/node
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
env:
TAG_LATEST: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.tag_latest) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ env.TAG_LATEST }}
type=sha
type=ref,event=tag
type=semver,pattern={{version}}
- name: Build and push image (linux/amd64)
uses: docker/build-push-action@v5
with:
context: .
file: deployments/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Summary
run: |
echo "Image pushed: ${{ env.IMAGE_NAME }}"
echo "Ref: ${{ github.ref }}"
echo "Tags:\n${{ steps.meta.outputs.tags }}"