Merge pull request #29 from g3rhard/renovate/docker-dockerfile-1 #13
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/Publish Image | |
on: | |
push: | |
branches: [production] | |
paths-ignore: | |
- README.md | |
- .trunk | |
workflow_dispatch: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Get current date | |
run: echo "DATE=$(date +'%Y.%m.%d')" >> "$GITHUB_ENV" | |
- name: Build and push | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ github.repository }}:${{ env.DATE }}-${{ github.ref_name }} | |
platforms: linux/amd64,linux/arm64 | |
- name: Create a Release | |
uses: elgohr/Github-Release-Action@edea2b66b44cdd48a00eb134b39959db2703b1cd # 20240405193535 | |
if: success() | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: "Release ${{ env.DATE }}" | |
- name: Send Discord notification | |
uses: sarisia/actions-status-discord@ce8cc68e4e626000136b3c702d049a154243e490 # v1 | |
if: always() | |
with: | |
title: "Build image on ${{ github.repository }}: ${{ github.workflow }}" | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
status: ${{ job.status }} |