Merge pull request #21 from SlothCroissant/dependabot/docker/caddy-2.… #267
Workflow file for this run
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
# This is a basic workflow to help you get started with Actions | |
name: Docker Build & Push | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
env: | |
DOCKER_USERNAME: slothcroissant | |
DOCKER_CONTAINER_NAME: caddy-cloudflaredns | |
DOCKER_TARGET_PLATFORM: linux/amd64, linux/arm64, linux/arm/v8, linux/arm/v7 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
if: ${{ !github.event.act }} # skip during local actions testing | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Prepare | |
if: success() | |
id: prepare | |
run: | | |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} | |
echo "::set-output name=tag::$(git describe --tags --abbrev=0)" | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ env.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Quay Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ env.DOCKER_USERNAME }}+pushbot | |
password: ${{ secrets.QUAY_TOKEN }} | |
- name: Build container and Push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: ${{ env.DOCKER_TARGET_PLATFORM }} | |
push: true | |
tags: | | |
${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} | |
${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest | |
ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} | |
ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest | |
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} | |
quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest |