Skip to content

Commit

Permalink
Merge pull request #222 from Security-Tools-Alliance/test-ci-build
Browse files Browse the repository at this point in the history
ci: rework tag and labels for Docker CI Build
  • Loading branch information
AnonymousWP authored Nov 7, 2024
2 parents 0ec7383 + a56143c commit e86006a
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ jobs:
strategy:
matrix:
image: [celery, web, postgres, redis, ollama, certs, proxy]
platform: [linux/amd64, linux/arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=latest" >> $GITHUB_OUTPUT
fi
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PROJECT }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v') || contains(github.ref, 'release/') }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v') || contains(github.ref, 'release/') }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
flavor: |
prefix=rengine-${{ matrix.image }}-,onlatest=true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -70,10 +74,9 @@ jobs:
context: ./docker/${{ matrix.image }}
file: ./docker/${{ matrix.image }}/Dockerfile
push: ${{ github.event_name != 'pull_request' || github.event.inputs.push_image == 'true' }}
tags: |
${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PROJECT }}:rengine-${{ matrix.image }}-${{ steps.get_version.outputs.VERSION }}
${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PROJECT }}:rengine-${{ matrix.image }}-latest
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64

update-release:
needs: build-and-push
Expand Down

0 comments on commit e86006a

Please sign in to comment.