Create a workflow to build image

This commit is contained in:
Ben Sarmiento
2023-10-21 01:44:29 +02:00
parent e361807119
commit 92abf2fd8c
2 changed files with 43 additions and 2 deletions

41
.github/workflows/image.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Publish Multi-platform Docker Image to Github Container Registry
on:
push:
branches: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/debridmediamanager/zurg:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache