Skip to content

Docker Image CI

Docker Image CI #19

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
jobs:
push-to-registry:
name: Push to registry
strategy:
matrix:
include:
- registry: 'docker.io'
- registry: 'ghcr.io'
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: Log in
uses: docker/login-action@v3
with:
registry: ${{ matrix.registry }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ matrix.registry == 'docker.io' && secrets.DOCKER_PASSWORD || secrets.CR_PAT }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.registry == 'ghcr.io' && 'ghcr.io/' || '' }}tuanngocptn/sentry-telegram-webhook
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# id: attest
# with:
# subject-name: index.docker.io/tuanngocptn/sentry-telegram-webhook
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true