2021-02-03 11:41:11 +03:00
|
|
|
name: Publish Docker Image
|
|
|
|
|
|
|
|
on:
|
2023-03-25 03:53:15 +03:00
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2021-02-03 11:41:11 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker-publish:
|
2022-05-20 10:34:54 +03:00
|
|
|
name: 'Build and publish Docker image'
|
2021-02-03 11:41:11 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-07-09 06:58:16 +03:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set version
|
|
|
|
run: |
|
|
|
|
(git describe --tags --exact-match \
|
|
|
|
|| git symbolic-ref -q --short HEAD \
|
|
|
|
|| git rev-parse --short HEAD) > version.txt 2> /dev/null
|
|
|
|
|
2021-07-09 09:17:50 +03:00
|
|
|
- name: Set up QEMU
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-07-09 09:17:50 +03:00
|
|
|
|
2021-02-03 11:41:11 +03:00
|
|
|
- name: Set up Docker Buildx
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-02-03 11:41:11 +03:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/login-action@v2
|
2021-02-03 11:41:11 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2021-10-21 12:41:49 +03:00
|
|
|
- name: Log in to the Container registry
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/login-action@v2
|
2021-10-21 12:41:49 +03:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-01-16 06:53:21 +03:00
|
|
|
- name: Docker Metadata
|
|
|
|
id: meta
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/metadata-action@v4
|
2022-01-16 06:53:21 +03:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
ghcr.io/${{ github.repository }}
|
|
|
|
n1try/wakapi
|
|
|
|
tags: |
|
|
|
|
latest
|
|
|
|
alpine
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
|
2021-12-02 15:03:38 +03:00
|
|
|
- name: Build and push
|
2023-04-04 15:52:33 +03:00
|
|
|
uses: docker/build-push-action@v4
|
2021-02-03 11:41:11 +03:00
|
|
|
with:
|
2022-07-09 06:58:16 +03:00
|
|
|
context: .
|
2021-12-15 17:35:51 +03:00
|
|
|
file: Dockerfile
|
2021-02-03 11:41:11 +03:00
|
|
|
push: true
|
2022-01-03 19:06:35 +03:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2022-01-16 06:53:21 +03:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
2021-10-21 12:41:49 +03:00
|
|
|
cache-from: type=registry,ref=n1try/wakapi:buildcache-alpine
|
|
|
|
cache-to: type=registry,ref=n1try/wakapi:buildcache-alpine,mode=max
|