Skip to content

Commit

Permalink
ci: add workflow for publishing docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Gustav Grusell <[email protected]>
  • Loading branch information
grusell committed Jun 18, 2024
1 parent 0d0add2 commit 4c4fb02
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.HUB_DOCKER_USERNAME }}
password: ${{ secrets.HUB_DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: eyevinntechnology/encore-packager

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eyevinn/encore-packager",
"version": "1.0.0",
"version": "0.1.0",
"description": "The default typescript-nodejs template for eyevinn projects",
"bin": {
"encore-packager": "./dist/cli.js"
Expand All @@ -13,7 +13,8 @@
"pretty": "prettier --check --ignore-unknown .",
"typecheck": "tsc --noEmit -p tsconfig.json",
"dev": "nodemon",
"start": "ts-node -T src/cli.ts"
"start": "ts-node -T src/cli.ts",
"postversion": "git push && git push --tags"
},
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 4c4fb02

Please sign in to comment.