Skip to content

Commit

Permalink
chore: add docker image to release automation (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
shini4i committed Jun 27, 2024
1 parent 9ca0684 commit 0b76c05
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
- 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:
Expand All @@ -30,3 +34,23 @@ jobs:
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 }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG VERSION

FROM node:22-alpine

RUN npm install --global @shini4i/clickhouse-migrations@${VERSION}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shini4i/clickhouse-migrations",
"version": "0.1.14",
"version": "0.1.15",
"description": "ClickHouse Migrations",
"bin": {
"clickhouse-migrations": "lib/cli.js"
Expand Down
2 changes: 1 addition & 1 deletion src/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const migration = async (
const migrate = () => {
const program = new Command();

program.name('clickhouse-migrations').description('ClickHouse migrations.').version('0.1.13');
program.name('clickhouse-migrations').description('ClickHouse migrations.').version('0.1.15');

program
.command('migrate')
Expand Down

0 comments on commit 0b76c05

Please sign in to comment.