Skip to content

remove extraneous run command #5

remove extraneous run command

remove extraneous run command #5

name: Build and publish cloudflare-ddns image
on: # yamllint disable-line rule:truthy
push:
branches:
- main
paths:
- cloudflare-ddns/*
- .github/workflows/publish-cloudflare-ddns.yaml
env:
DOCKER_USERNAME: brettinternet
IMAGE_NAME: cloudflare-ddns
DESCRIPTION: An Alpine image to update git mirrors
defaults:
run:
working-directory: ./cloudflare-ddns
jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skipci')"
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=auto
tags: type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./${{ env.IMAGE_NAME }}
file: ./${{ env.IMAGE_NAME }}/Dockerfile
platforms: arm64,amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
org.opencontainers.image.name=${{ env.IMAGE_NAME }}
org.opencontainers.image.source=https://github.com/brettinternet/containers/tree/main/${{ env.IMAGE_NAME }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
org.opencontainers.image.licenses=MIT
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
repository: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
short-description: ${{ env.DESCRIPTION }}
readme-filepath: ./${{ env.IMAGE_NAME }}/README.md