Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Merge pull request #25 from wandera/dependabot/github_actions/docker/… #10

Merge pull request #25 from wandera/dependabot/github_actions/docker/…

Merge pull request #25 from wandera/dependabot/github_actions/docker/… #10

Workflow file for this run

name: Docker
on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
env:
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Determine tag or commit
uses: haya14busa/action-cond@v1
id: refortag
with:
cond: ${{ startsWith(github.ref, 'refs/tags/') }}
if_true: ${{ github.ref }}
if_false: latest
- name: Determine image tag
id: imagetag
run: echo "value=${TAG_OR_BRANCH##*/}" >> $GITHUB_OUTPUT
env:
TAG_OR_BRANCH: ${{ steps.refortag.outputs.value }}
- name: Build logging-operator
uses: docker/build-push-action@v3
with:
file: Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: |
ghcr.io/banzaicloud/logging-operator:${{ steps.imagetag.outputs.value }}
banzaicloud/logging-operator:${{ steps.imagetag.outputs.value }}