Fixed image dangling logic and added InUse field to images #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["*"] | |
pull_request: | |
branches: ["main"] | |
env: | |
VERSION: "1.5.4" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract tag | |
shell: bash | |
run: echo "tag=`echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | awk '{ if ($0 == "main") {print "latest"} else {print $0;} }'`" >> $GITHUB_OUTPUT | |
id: extract_tag | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to ProductiveOps Docker Hub Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERREGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKERREGISTRY_PASSWORD }} | |
- name: Build and Push Server | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}" | |
file: Dockerfile.server | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: productiveops/dokemon:${{ steps.extract_tag.outputs.tag }}${{ steps.extract_tag.outputs.tag == 'latest' && format(' , productiveops/dokemon:{0}', env.VERSION) || '' }} | |
- name: Build and Push Agent | |
uses: docker/build-push-action@v5 | |
with: | |
context: "{{defaultContext}}" | |
file: Dockerfile.agent | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: productiveops/dokemon-agent:${{ steps.extract_tag.outputs.tag }}${{ steps.extract_tag.outputs.tag == 'latest' && format(' , productiveops/dokemon-agent:{0}', env.VERSION) || '' }} |