Skip to content

chore: add docker image to release automation (#6) #1

chore: add docker image to release automation (#6)

chore: add docker image to release automation (#6) #1

Workflow file for this run

name: Publish to NPM
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Build the project
run: npm run build
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Prepare version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: .
tags: |
ghcr.io/shini4i/clickhouse-migrations:${{ github.ref_name }}
push: true
build-args: |
VERSION=${{ env.VERSION }}