Skip to content

chore: pin github actions digests (#38) #2

chore: pin github actions digests (#38)

chore: pin github actions digests (#38) #2

Workflow file for this run

name: Deploy Images to GHCR
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches:
- main
tags:
- "v*"
release:
types:
- published
workflow_dispatch:
jobs:
push-image:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12]
permissions:
contents: read
packages: write
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
github-token: ${{ github.token }}
flavor: |
latest=auto
suffix=${{ matrix.node != 10 && format('-node{0}', matrix.node) || '' }},onlatest=true
tags: |
type=edge,branch=main
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@4976231911ebf5f32aad765192d35f942aa48cb8
with:
context: .
push: true
build-args: |
NODE_VERSION=${{ matrix.node }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max