Skip to content

Commit

Permalink
feat: Push images to docker hub and ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Fritz Durchardt committed Aug 28, 2023
1 parent c3aeac6 commit 22ec6b4
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/flow-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: flow-build

on:
push:
branches: [ "release-2.0" ]
pull_request:
branches: [ "release-2.0" ]

jobs:
docker-buildx:
runs-on: ubuntu-latest
env:
image_name: myks
platforms: linux/amd64,linux/arm64

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
docker.io/enopsre/${{ env.image_name }}
ghcr.io/mykso/${{ env.image_name }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.platforms }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 22ec6b4

Please sign in to comment.