Skip to content

Commit 3c7656f

Browse files
tooryxcopybara-github
authored andcommitted
Add a workflow to build the callback server docker automatically.
PiperOrigin-RevId: 775686639 Change-Id: Ic21d04fd8aa0e5d2532aaba7ad82c82a0aec52c9
1 parent b25e2ac commit 3c7656f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/docker-push.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: docker-push
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: google/tsunami-security-scanner-callback-server
12+
13+
jobs:
14+
build-and-push-image:
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
packages: write
20+
attestations: write
21+
id-token: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata for Docker
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
40+
- name: Build and push Docker image
41+
id: push
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
49+
- name: Generate artifact attestation
50+
uses: actions/attest-build-provenance@v2
51+
with:
52+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
subject-digest: ${{ steps.push.outputs.digest }}
54+
push-to-registry: true

0 commit comments

Comments
 (0)