2024-05-15 15:17:33 +00:00
|
|
|
name: Push Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2024-10-09 02:51:46 +00:00
|
|
|
workflow_dispatch:
|
2024-05-15 15:17:33 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
push-docker-image:
|
|
|
|
name: Push Docker Image
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Retrieve major version
|
|
|
|
uses: winterjung/split@v2
|
|
|
|
id: split
|
|
|
|
with:
|
|
|
|
msg: ${{ github.ref_name }}
|
|
|
|
separator: .
|
|
|
|
- name: Log in to registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
2024-10-09 02:51:46 +00:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
2024-10-14 22:22:45 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
2024-05-15 15:17:33 +00:00
|
|
|
- name: Build and push the Docker image
|
2024-10-14 22:22:45 +00:00
|
|
|
uses: docker/build-push-action@v6
|
2024-05-15 15:17:33 +00:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
2024-10-14 22:22:45 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2024-05-15 15:17:33 +00:00
|
|
|
push: true
|
|
|
|
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.split.outputs._0 }},${{ secrets.DOCKERHUB_REPOSITORY }}:latest
|