Skip to content

Commit

Permalink
Try to use Docker meta action
Browse files Browse the repository at this point in the history
  • Loading branch information
yozik04 committed Apr 18, 2024
1 parent 7ef33f2 commit 2220bcf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
name: Publish to Docker Hub
uses: ./.github/workflows/publish_docker.yml
needs: test
with:
tag: dev-latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
9 changes: 0 additions & 9 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,3 @@ jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
publish_docker:
name: Publish to Docker Hub
uses: ./.github/workflows/publish_docker.yml
needs: test
with:
tag: latest
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
20 changes: 14 additions & 6 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Publish to Docker Hub

on:
workflow_call:
inputs:
tag:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
Expand All @@ -21,12 +17,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
paradoxalarminterface/pai
tags: |
type=ref,event=branch
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=pep440,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -37,4 +44,5 @@ jobs:
context: .
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64/v8
push: true
tags: paradoxalarminterface/pai:${{ inputs.tag }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
name: Publish to Docker Hub
uses: ./.github/workflows/publish_docker.yml
needs: test
with:
tag: ${{ github.event.release.tag_name }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down

0 comments on commit 2220bcf

Please sign in to comment.