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 6bd75d2
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/flow-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: flow-build

on:
pull_request_target:
types:
- opened
- edited
- synchronize
-
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: mykso
password: ${{ secrets.MYKSO_DOCKERHUB_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 6bd75d2

Please sign in to comment.