Add tags for with docker meta version #189
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
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Dockerfiles/**' | |
- '.github/workflows/publish.yml' | |
- 'docker-bake.hcl' | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
Publish: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
buildType: ["source", "pypi", "experimental"] | |
buildArch: ["slim", "alpine"] | |
steps: | |
- name: Login to Docker | |
uses: docker/login-action@v3 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login To GitHub | |
uses: docker/login-action@v3 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login To GitLab | |
uses: docker/login-action@v3 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
registry: registry.gitlab.com | |
username: ${{ secrets.GITLAB_USER }} | |
password: ${{ secrets.GITLAB_TOKEN }} | |
- name: Docker Meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
flavor: | | |
latest=false | |
images: cyb3rjak3/html5validator,ghcr.io/cyb3r-jak3/html5validator,registry.gitlab.com/cyb3r-jak3/html5validator-docker | |
labels: | | |
org.label-schema.vcs-url=https://github.com/Cyb3r-Jak3/html5validator-docker.git | |
maintainer=Cyb3r Jak3 git@cyberjake.xyz | |
org.opencontainers.image.vendor=cyb3rjak3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/checkout@v4 | |
- name: Build | |
uses: docker/bake-action@v4 | |
with: | |
files: | | |
${{ steps.meta.outputs.bake-file }} | |
./docker-bake.hcl | |
targets: ${{matrix.buildType}}-${{matrix.buildArch}}-release | |
push: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
set: | | |
*.cache-from=type=gha,scope=buildx-${{matrix.buildType}}-${{matrix.buildArch}} | |
*.cache-to=type=gha,mode=max,scope=buildx-${{matrix.buildType}}-${{matrix.buildArch}} |