Skip to content

make npm publish occur on tag push rather than release #5

make npm publish occur on tag push rather than release

make npm publish occur on tag push rather than release #5

# Action to build container image and publish to
# GitHub Container Registry (ghcr.io). This runs
# only for pushes to the master branch such as a merge.
name: Package and publish container image
on:
push:
branches:
- master
tags:
- "*"
jobs:
publish:
name: Package and publish container image
runs-on: ubuntu-22.04
steps:
# SHA tag for every push to master
# "edge" tag for every push to master
# semver tag for every tag push matching semver
# latest for the newest tag semver tag push
- name: Generate docker image meta tags
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/bluehatbrit/mdpdf
flavor: |
latest=true
tags: |
type=sha,event=push,branch=$repo.default_branch,prefix=
type=edge,event=push,branch=$repo.default_branch
type=semver,pattern={{version}},prefix=v
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: bluehatbrit
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}