-
Notifications
You must be signed in to change notification settings - Fork 98
62 lines (54 loc) · 1.75 KB
/
build-push-container.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
59
60
61
62
# Will automatically build and push new docker image on release
name: Publish Docker image
on:
push:
branches: [main]
tags:
- "v*"
jobs:
push_to_registries:
name: Build and push images
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) - TRAM image
id: meta_tram
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.url=https://ctid.mitre-engenuity.org/our-work/tram/
- name: Build and push TRAM application container image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta_tram.outputs.tags }}
labels: ${{ steps.meta_tram.outputs.labels }}
- name: Extract metadata (tags, labels) - nginx image
id: meta_nginx
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository }}-nginx
labels: |
org.opencontainers.image.url=https://ctid.mitre-engenuity.org/our-work/tram/
- name: Build and push Nginx TRAM container image
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile.nginx
push: true
tags: ${{ steps.meta_nginx.outputs.tags }}
labels: ${{ steps.meta_nginx.outputs.labels }}