Skip to content

Commit 076f33c

Browse files
committed
add the docker release workflow
1 parent 544ce92 commit 076f33c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: datadog/appsec-threat-emulation
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
docker-build-push:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2.5.0
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Log into registry ${{ env.REGISTRY }}
28+
uses: docker/login-action@v2.1.0
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v3.2.0
36+
with:
37+
context: .
38+
push: true
39+
build-args: |
40+
VERSION=${{ github.ref_name }}
41+
tags: |
42+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
43+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

0 commit comments

Comments
 (0)