Merge remote-tracking branch 'origin/dependabot/go_modules/github.com… #17
This file contains hidden or 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 | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- ".github/workflows/test.yml" | |
- "compose.example.yml" | |
- "tests/*" | |
- "README.md" | |
- "LICENSE.txt" | |
- ".gitignore" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE: ${{github.repository}} | |
jobs: | |
push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container repo | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Obtain the version from the commit ID | |
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Build and push docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/386,linux/arm64 | |
tags: | | |
${{env.REGISTRY}}/${{env.IMAGE}}:${{env.VERSION}} | |
${{env.REGISTRY}}/${{env.IMAGE}}:latest |