Skip to content

fix: docker publish for latest tag #119

fix: docker publish for latest tag

fix: docker publish for latest tag #119

Workflow file for this run

name: Publish
on:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release please
uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
- name: Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
if: ${{ steps.release.outputs.release_created }}
- name: Install dependencies
run: bun install --production
if: ${{ steps.release.outputs.release_created }}
- name: Build package
run: bun run build
if: ${{ steps.release.outputs.release_created }}
- name: Publish to npmjs
run: npm publish --access public
env:
NPM_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
if: ${{ steps.release.outputs.release_created }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ steps.release.outputs.release_created }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: kitabisa/smockr
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha
if: ${{ steps.release.outputs.release_created }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
if: ${{ steps.release.outputs.release_created }}
- name: Publish to DockerHub
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
if: ${{ steps.release.outputs.release_created }}