Skip to content

Commit

Permalink
update actions to publish docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Eiko Thomas committed Feb 23, 2024
1 parent 17ac397 commit 5c9946d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
45 changes: 26 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: build image
run: ./buildImage.sh
- name: Login to GitHub Registry
run: echo ${{ secrets.GH_PUBLISH_TOKEN }} | docker login ghcr.io -u okieoth --password-stdin
- name: Push the Docker image
run: docker push ghcr.io/okieoth/mschemaguesser:`cat version.txt | grep -P '\d+\.\d+\.\d+'`
- name: Push the latest Docker image
run: docker push ghcr.io/okieoth/mschemaguesser
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GH_PUBLISH_TOKEN: ${{ secrets.GH_PUBLISH_TOKEN }}
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: CHANGELOG.md
draft: false
prerelease: false
context: .
push: true
file: Dockerfile.release
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.1

0 comments on commit 5c9946d

Please sign in to comment.