Skip to content

Commit

Permalink
Using github container registry based on `api/.github/workflows/docke…
Browse files Browse the repository at this point in the history
…r-image.yml`

Signed-off-by: Peter Baker <[email protected]>
  • Loading branch information
PeterBaker0 committed Aug 5, 2024
1 parent e26ddac commit 69b468a
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/publish-conductor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
name: Publish Conductor API to DockerHub
name: Publish Conductor API Container to GHCR
on:
push:
branches:
- main
- publish-to-ghcr
release:
types: [published]

# Defines two custom environment variables for the workflow. These are
# used for the Container registry domain, and a name for the Docker
# image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: faims-api

jobs:
build-and-push:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -18,17 +30,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
# Uses the `docker/login-action` action to log in to the Container registry
# using the account and password that will publish the packages.
# Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKERHUB_REPOSITORY }}/faims3-api-test
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,prefix=sha-
type=ref,event=branch
Expand Down

0 comments on commit 69b468a

Please sign in to comment.