This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
chore(deps): update actions/checkout action to v4.2.1 (#53) #96
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 Build | |
'on': | |
push: | |
tags: [ '*.*.*' ] | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
DOCKER_IMAGE: etriasnl/fluentd | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/[email protected] | |
- | |
uses: docker/[email protected] | |
with: | |
buildkitd-config-inline: | | |
[registry."docker.io"] | |
mirrors = ["mirror.gcr.io"] | |
- | |
id: build | |
uses: docker/[email protected] | |
with: | |
context: . | |
load: true | |
# https://docs.docker.com/build/ci/github-actions/cache/#github-cache | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- | |
run: | | |
docker run --rm "${{ steps.build.outputs.imageid }}" fluentd --version | |
docker run --rm "${{ steps.build.outputs.imageid }}" fluent-gem list | |
- | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
if: github.ref_type == 'tag' | |
- | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.DOCKER_IMAGE }} | |
if: github.ref_type == 'tag' | |
- | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
if: github.ref_type == 'tag' |