Merge pull request #3 from Liana64/main #2
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 | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- "*" | |
jobs: | |
build: | |
if: "!github.event.head_commit.message || contains(github.event.head_commit.message, 'Feature') || contains(github.event.head_commit.message, 'feature') || contains(github.event.head_commit.message, 'Release') || contains(github.event.head_commit.message, 'release')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Lowercase repository owner | |
shell: bash | |
run: echo "LOWERCASE_REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: "${{ github.actor }}" | |
password: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Build Image | |
uses: docker/build-push-action@v6 | |
id: build | |
with: | |
context: . | |
platforms: "amd64" | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: | | |
ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/unique-turker:${{ github.sha }} | |
ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/unique-turker:latest | |
labels: |- | |
org.opencontainers.image.title="unique-turker" | |
org.opencontainers.image.url=https://ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/unique-turker | |
org.opencontainers.image.version="latest" | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.vendor=${{ env.LOWERCASE_REPO_OWNER }} |