2021-02-03 11:41:11 +03:00
|
|
|
name: Publish Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*.*.*'
|
|
|
|
- '!*.*.*-*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker-publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
# https://stackoverflow.com/questions/58177786
|
|
|
|
- name: Get version
|
|
|
|
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
|
2021-07-09 09:17:50 +03:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
2021-02-03 11:41:11 +03:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2021-10-21 12:41:49 +03:00
|
|
|
- name: Log in to the Container registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-12-02 15:03:38 +03:00
|
|
|
- name: Build and push
|
2021-02-03 11:41:11 +03:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
2021-12-15 17:35:51 +03:00
|
|
|
file: Dockerfile
|
2021-02-03 11:41:11 +03:00
|
|
|
push: true
|
|
|
|
tags: |
|
2021-12-02 15:03:38 +03:00
|
|
|
n1try/wakapi:latest
|
2021-12-15 17:35:51 +03:00
|
|
|
n1try/wakapi:alpine
|
2021-12-02 15:03:38 +03:00
|
|
|
n1try/wakapi:${{ env.GIT_TAG }}
|
|
|
|
ghcr.io/${{ github.repository }}:latest
|
2021-12-15 17:35:51 +03:00
|
|
|
ghcr.io/${{ github.repository }}:alpine
|
2021-12-02 15:03:38 +03:00
|
|
|
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}
|
2021-07-09 09:17:50 +03:00
|
|
|
platforms: linux/amd64,linux/arm64
|
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
|