Skip to content

Commit ffdc8c2

Browse files
committed
publish to docker reg
1 parent cdf9934 commit ffdc8c2

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

.github/workflows/build-and-deploy-docker-image.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,52 @@ name: Build and Deploy Docker Image
22

33
on: [workflow_dispatch]
44

5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
59
jobs:
610
build-and-deploy:
711
runs-on: ubuntu-latest
812

13+
permissions:
14+
contents: read
15+
packages: write
16+
attestations: write
17+
id-token: write
18+
919
steps:
1020
- name: Checkout repository
1121
uses: actions/checkout@v4
1222

23+
- name: Log in to the Container registry
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
1336
- name: Set up Docker Buildx
1437
uses: docker/setup-buildx-action@v2
1538

16-
- name: Build Docker image
39+
- name: Build and push Docker image
40+
id: push
1741
uses: docker/build-push-action@v5
1842
with:
1943
context: .
20-
push: false
21-
tags: sql-data-guard:latest
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
48+
- name: Generate artifact attestation
49+
uses: actions/attest-build-provenance@v2
50+
with:
51+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
52+
subject-digest: ${{ steps.push.outputs.digest }}
53+
push-to-registry: true

0 commit comments

Comments
 (0)