Skip to content

Commit

Permalink
Adding dockerhub release method
Browse files Browse the repository at this point in the history
  • Loading branch information
dblane-digicatapult committed Oct 22, 2024
1 parent 405274c commit ccfa6eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ jobs:

steps:
- uses: actions/checkout@v4

# Docker build
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -98,7 +100,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: "--debug"
buildkitd-flags: '--debug'
- name: Generate tags
id: generate-tags
env:
Expand All @@ -111,23 +113,33 @@ jobs:
run: |
if [ "$IS_NEW_VERSION" == "true" ]; then
echo "GHCR_VERSION_TAG=ghcr.io/${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:$VERSION" >> $GITHUB_OUTPUT
echo "DOCKERHUB_VERSION_TAG=${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:$VERSION" >> $GITHUB_OUTPUT
if [ "$IS_PRERELEASE" == "false" ]; then
echo "GHCR_LATEST_TAG=ghcr.io/${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:latest" >> $GITHUB_OUTPUT
echo "DOCKERHUB_LATEST_TAG=${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:latest" >> $GITHUB_OUTPUT
else
echo "GHCR_LATEST_TAG=" >> $GITHUB_OUTPUT
echo "DOCKERHUB_LATEST_TAG=" >> $GITHUB_OUTPUT
fi;
else
echo "GHCR_VERSION_TAG=" >> $GITHUB_OUTPUT
echo "GHCR_LATEST_TAG=" >> $GITHUB_OUTPUT
echo "DOCKERHUB_VERSION_TAG=" >> $GITHUB_OUTPUT
echo "DOCKERHUB_LATEST_TAG=" >> $GITHUB_OUTPUT
fi;
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Dockerhub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.BRIDGEAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.BRIDGEAI_DOCKERHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
Expand All @@ -138,6 +150,9 @@ jobs:
ghcr.io/${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:${{ github.sha }}
${{ steps.generate-tags.outputs.GHCR_VERSION_TAG }}
${{ steps.generate-tags.outputs.GHCR_LATEST_TAG }}
${{ needs.preconditions.outputs.org_name }}/${{ needs.preconditions.outputs.repo_name }}:${{ github.sha }}
${{ steps.generate-tags.outputs.DOCKERHUB_VERSION_TAG }}
${{ steps.generate-tags.outputs.DOCKERHUB_LATEST_TAG }}
labels: |
org.opencontainers.image.title=${{ needs.preconditions.outputs.repo_name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
Expand All @@ -149,16 +164,16 @@ jobs:
# Build github release
- name: Build release version
uses: "marvinpinto/action-automatic-releases@latest"
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: ${{ needs.check-version.outputs.version }}
prerelease: false
title: Release ${{ needs.check-version.outputs.version }}
- name: Build release latest
uses: "marvinpinto/action-automatic-releases@latest"
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: latest
prerelease: false
title: Latest Release ${{ needs.check-version.outputs.version }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bridgeai-drift-monitoring"
version = "0.1.1"
version = "0.2.0"
description = ""
authors = ["DC AI Team <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit ccfa6eb

Please sign in to comment.