Skip to content

Merge pull request #8 from selim13/dependabot/github_actions/actions/… #22

Merge pull request #8 from selim13/dependabot/github_actions/actions/…

Merge pull request #8 from selim13/dependabot/github_actions/actions/… #22

name: Deploy docker image
on:
push:
branches:
- "master"
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
images: |
${{ secrets.DOCKERHUB_REPOSITORY }}
ghcr.io/${{ github.repository }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}