Skip to content

Commit

Permalink
Build branches for specific docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Sep 10, 2024
1 parent 12511fe commit 56f2ef2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/docker-publish-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish latest image
on:
workflow_dispatch:
push:
branches:
- '*'
- '!master'
env:
BUILD_NUMBER: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
IMAGE_NAME: delib/deliberationsbe
IMAGE_VERSION: ${{ github.head_ref || github.ref_name }}

jobs:
docker:
runs-on:
group: self-hosted
steps:
- name: Output build number
run: echo ${{ env.BUILD_NUMBER }}
- name: Build, push image and notify
uses: IMIO/gha/[email protected]
with:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
IMAGE_TAGS: |
${{ secrets.HARBOR_URL }}/${{ env.IMAGE_NAME }}:latest
REGISTRY_URL: ${{ secrets.HARBOR_URL }}
REGISTRY_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }}
CONTEXT: '.'
DOCKERFILE: 'Dockerfile'
BUILD_ARGS: 'build_number=${{ env.BUILD_NUMBER }}'
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Publish latest image
on:
workflow_dispatch:
push:
branches:
- 'master'
env:
IMAGE_NAME: delib/deliberationsbe
BUILD_NUMBER: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
IMAGE_NAME: delib/deliberationsbe
IMAGE_VERSION: latest

jobs:
docker:
Expand Down

0 comments on commit 56f2ef2

Please sign in to comment.