This commit is contained in:
aluvare 2022-12-13 13:38:24 +01:00
parent 5fcd679e5e
commit 97a91f9350
2 changed files with 52 additions and 33 deletions

View File

@ -1,33 +0,0 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/aluvare/vnc-recorder/vnc-recorder
tag-sha: true
tag-semver: |
{{major}}.{{minor}}s
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
path: .
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
repository: aluvare/vnc-recorder/vnc-recorder
tag_with_ref: true

52
.github/workflows/docker-build.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Install QEMU
uses: docker/setup-qemu-action@v1
- name: Install Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Check out the repo
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: ghcr.io/aluvare/vnc-recorder/vnc-recorder
tag-sha: true
# Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
file: ./Dockerfile
context: .
platforms: linux/amd64,linux/arm64/v8
push: "${{ github.event_name != 'pull_request' }}"
tags: "${{ steps.meta.outputs.tags }}"
labels: "${{ steps.meta.outputs.labels }}"