-
Notifications
You must be signed in to change notification settings - Fork 91
58 lines (51 loc) · 1.81 KB
/
publish-insecure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish Docker images
on:
release:
types: [published]
schedule:
- cron: '0 0 * * *' # Nightly builds
workflow_dispatch: # Manually trigger a workflow run
jobs:
push_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
image-data:
- name: insecure-app
image: confusedcrib/insecure-app
context: ./insecure-app
dockerfile: ./insecure-app/Dockerfile
- name: insecure-java
image: confusedcrib/insecure-java
context: ./insecure-java
dockerfile: ./insecure-java/Dockerfile
- name: insecure-js
image: confusedcrib/insecure-js
context: ./insecure-js
dockerfile: ./insecure-js/Dockerfile
- name: workload-security-evaluator
image: confusedcrib/workload-security-evaluator
context: ./workload-security-evaluator
dockerfile: ./workload-security-evaluator/Dockerfile
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata for ${{ matrix.image-data.name }}
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ matrix.image-data.image }}
- name: Build and push ${{ matrix.image-data.name }} Docker image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.image-data.context }}
file: ${{ matrix.image-data.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}