Docker #5
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
# Based on https://github.com/docker/build-push-action | |
name: "Docker" | |
on: | |
release: # A GitHub release was published | |
types: [published] | |
workflow_dispatch: # A build was manually requested | |
workflow_call: # Another pipeline called us | |
secrets: | |
DOCKER_TOKEN: | |
required: true | |
env: | |
DOCKER_NAMESPACE: privoce | |
DOCKER_HUB_USER: privoce | |
PLATFORMS: linux/amd64 | |
jobs: | |
palpo: | |
name: Palpo image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
security-events: write # To upload Trivy sarif files | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get release tag & build flags | |
if: github.event_name == 'release' # Only for GitHub releases | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ env.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build main palpo image | |
if: github.ref_name == 'main' | |
id: docker_build_palpo | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./build/docker/Dockerfile.palpo | |
platforms: ${{ env.PLATFORMS }} | |
push: true | |
tags: | | |
${{ env.DOCKER_NAMESPACE }}/vocechat-matrix-palpo:${{ github.ref_name }} |