docker: Tag and push images to GHCR automatically
Co-authored-by: BrailleBennett <BrailleBennett@users.noreply.github.com> Co-authored-by: TheSuperGamer20578 <TheSuperGamer20578@users.noreply.github.com>
This commit is contained in:
parent
68bb381ece
commit
a82881b7d3
1 changed files with 16 additions and 1 deletions
17
.github/workflows/ci-docker.yml
vendored
17
.github/workflows/ci-docker.yml
vendored
|
|
@ -5,6 +5,8 @@ on: [push, pull_request]
|
|||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -14,12 +16,25 @@ jobs:
|
|||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to ghcr.io
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Generate version information
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,windows/amd64
|
||||
push: false
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
pull: true
|
||||
cache-from: type=gha, scope=${{ github.workflow }}
|
||||
cache-to: type=gha, scope=${{ github.workflow }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue