Skip to content

Commit

Permalink
chore(actions): publication action (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbioteau authored Nov 16, 2023
1 parent 3737ea5 commit 6fa8932
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 16 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish image

on:
workflow_dispatch:
inputs:
vendor:
description: Select the vendor image to publish on docker.io
type: choice
default: ''
required: true
options:
- postgres
- mysql
- sqlserver
vendorVersion:
description: Set the vendor specific version folder
type: string
default: ''
required: true
imageVersion:
description: Set the image version to publish on docker.io
type: string
default: ''
required: true
isLatest:
description: Publish a latest tag for this image
type: boolean
default: true
required: true

env:
REGISTRY: docker.io
DOCKER_IO_REGISTRY_USER: bonitadev
IMAGE_NAME: bonitasoft/bonita-${{ github.event.inputs.vendor }}

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to docker.io registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ env.DOCKER_IO_REGISTRY_USER }}
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}
- name: Build image
run: docker build -t ${{ env.IMAGE_NAME }}:${{ github.event.inputs.imageVersion }} ${{ github.event.inputs.vendor }}/${{ github.event.inputs.imageVersion }}
- name: Publish to docker.io
run: |
docker push ${{ env.IMAGE_NAME }}
- name: Publish as latest to docker.io
if: {{ github.event.inputs.isLatest }}
run: |
docker tag ${{ env.IMAGE_NAME }}:${{ github.event.inputs.imageVersion }} ${{ env.IMAGE_NAME }}:latest
docker publish ${{ env.IMAGE_NAME }}:latest
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,9 @@ For instance with PostgreSQL: `docker build -t bonitasoft/bonita-postgres:15.4 .

## Publish images on Docker Hub

Requires to have the image built locally.
Use the publication Github action:

1. Login onto Docker Hub with account `bonitadev` (see Keeper for account credentials):

```shell
docker login -u bonitadev docker.io
```

2. Push the image and its tagged name + latest tag:

```shell
docker push bonitasoft/bonita-<vendor>:<version>
docker tag bonitasoft/bonita-<vendor>:<version> bonitasoft/bonita-<vendor>:latest
docker push bonitasoft/bonita-<vendor>:latest
```

3. Ensure the images are pushed, accessing https://hub.docker.com/u/bonitasoft and checking tags are there.
* Select the database vendor
* Set the vendor version folder
* Set an image version
* Set if this version should be tagged as latest

0 comments on commit 6fa8932

Please sign in to comment.