Skip to content

Commit

Permalink
Edit docker build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanngocptn committed May 9, 2024
1 parent e6a461c commit 0927ddc
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,40 @@ on:
workflow_dispatch:

jobs:
build:
push-to-registry:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- run: echo ${{ steps.package-version.outputs.current-version}}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag tuanngocptn/sentry-telegram-webhook:${{ steps.package-version.outputs.current-version}}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: 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
# with:
# subject-name: tuanngocptn/sentry-telegram-webhook
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true

0 comments on commit 0927ddc

Please sign in to comment.