Add image-publish CI

This commit is contained in:
alefvanoon 2022-07-06 14:24:53 +00:00 committed by GitHub
parent c751d8814d
commit b4626c377c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

38
.github/workflows/image-publish.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Build and Deploy to github packages
on:
workflow_dispatch:
inputs:
target:
description: 'Target Branch, tag or SHA'
required: true
default: 'main'
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/libremdb:latest
ghcr.io/${{ github.repository_owner }}/libremdb:${{ github.event.inputs.target }}
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline