Skip to content

Merge pull request #579 from cybozu-go/dependabot/go_modules/golang.o… #2

Merge pull request #579 from cybozu-go/dependabot/go_modules/golang.o…

Merge pull request #579 from cybozu-go/dependabot/go_modules/golang.o… #2

name: "Build Fluent Bit container"
on:
pull_request:
paths:
- "containers/fluent-bit/**"
- ".github/workflows/build-fluent-bit-container.yaml"
- "!**.md"
push:
branches:
- 'main'
paths:
- "containers/fluent-bit/**"
- ".github/workflows/build-fluent-bit-container.yaml"
- "!**.md"
jobs:
build:
runs-on: ${{ vars.IMAGE_BUILD_RUNNER || 'ubuntu-20.04' }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check TAG file
working-directory: containers
run: |
result="$(./tag_exists moco/fluent-bit fluent-bit)"
if [ "$result" = ok ]; then
exit 1
fi
echo "TAG=$(cat ./fluent-bit/TAG)" >> $GITHUB_ENV
- uses: docker/build-push-action@v4
with:
context: containers/fluent-bit/.
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/cybozu-go/moco/fluent-bit:${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max