-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (52 loc) · 1.53 KB
/
docker.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
name: docker
on:
workflow_call:
inputs:
jar-artifact:
description: "Name of the executable JAR artifact to download."
type: string
required: true
push:
description: "Whether to push the image."
type: boolean
required: true
default: false
tags:
description: "Image tags (comma separated) to build and push"
type: string
required: true
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout sources
uses: actions/checkout@v3
- name: Fetch jar
uses: actions/download-artifact@v3
with:
name: ${{ inputs.jar-artifact }}
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
id: docker_build_publication_server
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
push: ${{ inputs.push }}
tags: ${{ inputs.tags }}
labels: "org.label-schema.vcs-ref=${{ github.sha }}"
build-args: |
PUBLICATION_SERVER_JAR=./rpki-publication-server.jar
- name: Image digest
run: echo ${{ steps.docker_build_publication_server.outputs.digest }}