add buildx support

This commit is contained in:
ssplatt committed 2021-06-11 14:39:39 -04:00
1 parent 786df087d4
commit 66f6ce4d2a
2 files changed
+19 -8

No files matched your search

+18 -7
View File
@@ -2,7 +2,9 @@ name: Publish Docker image
on:
push:
branches: [master, develop]
branches: [master, develop, docker**]
release:
types: [published, created, edited]
jobs:
publish:
@@ -19,12 +21,13 @@ jobs:
run: |
REGISTRY="ghcr.io"
IMAGE="${REGISTRY}/${{ steps.repository.outputs.lowercase }}"
TAGS="${IMAGE}:${{ github.sha }}"
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAGS="${TAGS},${IMAGE}:latest"
fi
if [[ $GITHUB_REF == refs/heads/develop ]]; then
TAGS="${TAGS},${IMAGE}:develop"
TAGS="${IMAGE}:${{ github.sha }},${IMAGE}:latest"
if [[ $(dirname ${{ github.ref }}) = "refs/heads" ]]; then
TAGS="${TAGS},${IMAGE}:$(basename ${{ github.ref.lowecase }})"
elif [[ $(dirname ${{ github.ref }}) = "refs/tags" ]]; then
RELEASE=$(basename ${{ github.ref.lowercase }})
RELEASE=${RELEASE#"superalgos-"}
TAGS="${TAGS},${IMAGE}:${RELEASE}"
fi
echo ::set-output name=tags::${TAGS}
- name: Login in to registry
@@ -33,9 +36,17 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Push to registry
uses: docker/build-push-action@v2
with:
push: true
file: ./Docker/Dockerfile
tags: ${{ steps.prep.outputs.tags }}
platforms: ${{ steps.buildx.outputs.platforms }}
+1 -1
View File
@@ -4,7 +4,7 @@ services:
build:
context: ..
dockerfile: ./Docker/Dockerfile
image: superalgos
image: ghcr.io/superalgos/superalgos:latest
command: ["minMemo"]
ports:
- '34248:34248'