0
0
mirror of https://github.com/Snowiiii/Pumpkin.git synced 2024-12-04 18:58:17 +00:00
lokka30 120b92cfcc
workflows: begin work on docker image deployment (#214)
* workflows: begin work on docker image deployment

Started work on `docker.yml` for automatic docker image deployment on
pushes to to branches (notably, excluding people's PRs).

Useful resource:
<https://docs.docker.com/build/ci/github-actions/manage-tags-labels/>

* workflows: Minor adjustments to deploy-docker-image action

* workflows: updated docker image workflow according to GH docs

* workflows: temporarily test deployment via docker-deploy branch

* workflows: use only subject-name for attestation

* workflows: specify subject-path for attestation

* workflows: remove attestation for now, too fiddly

* workflows: remove tmp test branch
2024-11-20 23:12:12 +01:00

48 lines
1.0 KiB
YAML

name: deploy-docker-image
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches:
- "master"
jobs:
docker-build-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub CR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}