Skip to content

Commit

Permalink
add publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Aug 15, 2023
1 parent 64313c3 commit 4342c07
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: docker releases

on:
push:
branches-ignore:
- '**'
tags:
- '**'
workflow_dispatch:
inputs:
platform:
description: 'Platform'
default: 'linux/amd64,linux/arm64/v8'
required: false

jobs:
docker:
name: "Docker Image"
runs-on: ubuntu-latest
steps:

- name: Checkout Project
uses: actions/checkout@v3

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
wipac/mou-dashboard-services
tags: |
# branches (PRs)
type=sha,prefix={{branch}}-,enable=${{ github.ref_type == 'branch' }}
# release tags
type=semver,pattern={{major}},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
type=semver,pattern={{major}}.{{minor}}.{{patch}},enable=${{ github.ref_type == 'tag' }}
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
if: ${{ contains(github.event.inputs.platform || 'linux/amd64', 'arm') }}
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Push Docker Image X86_64
# if: ${{ arch != 'arm' }}
uses: docker/build-push-action@v3
with:
context: .
platforms: ${{ github.event.inputs.platform || 'linux/amd64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

# -
# name: Push Docker Image
# if: ${{ arch == 'arm' }}
# uses: docker/build-push-action@v3
# with:
# context: .
# platforms: linux/amd64,linux/arm64/v8
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.docker_meta.outputs.tags }}
# labels: ${{ steps.docker_meta.outputs.labels }}

0 comments on commit 4342c07

Please sign in to comment.