Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions .github/workflows/ghcr_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
push:
# only run on tags that match the regex
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch: # allows manual triggering of the workflow
# this allows the workflow to be triggered manually from the GitHub UI
inputs:
tag:
description: 'Tag to publish'
description: "Tag to publish"
required: true
default: 'latest' # default tag if not provided
default: "latest" # default tag if not provided
type: string

jobs:
Expand All @@ -28,17 +28,16 @@ jobs:
needs: build
if: needs.build.result == 'success'
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish mqtt-broker-flashmq image with ver and latest tag
run: |
# echo working directory
echo "Current working directory: $(pwd)"
sh scripts/ghcr-publish.sh mqtt-broker-flashmq mqtt-broker-flashmq:${{ github.ref_name }}

- name: Checkout the repo
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish mqtt-broker-flashmq image with ver and latest tag
run: |
# echo working directory
echo "Current working directory: $(pwd) and tag: ${{ github.ref_name }}"
sh scripts/ghcr-publish.sh mqtt-broker-flashmq ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion scripts/ghcr-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tag=$2
if [ -z "$tag" ]; then
tag="$package_name"
fi
tag_ref=ghcr.io/kindredgroup/mqtt-broker-flashmq/$tag
tag_ref=ghcr.io/kindredgroup/mqtt-broker-flashmq:$tag
echo "Building and publishing image with tag: $tag_ref"
docker build -f Dockerfile . --tag $tag_ref
#for ghcr.io access token mentioned in the github secrets and accessed in actions
Expand Down