mark all dirs as git safe #4
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: Build and publish update-mirrors image | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- main | |
paths: | |
- update-mirrors/* | |
- .github/workflows/publish-update-mirrors.yaml | |
env: | |
DOCKER_USERNAME: brettinternet | |
IMAGE_NAME: update-mirrors | |
DESCRIPTION: An Alpine image to update git mirrors | |
defaults: | |
run: | |
working-directory: ./update-mirrors | |
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 |