9
9
branches : [ main, dev ]
10
10
11
11
env :
12
- DOCKER_IMAGE : radarbase/radar-output-restructure
12
+ REGISTRY : ghcr.io
13
+ REPOSITORY : ${{ github.repository }}
14
+ IMAGE_NAME : radar-output-restructure
13
15
14
16
jobs :
15
- # Build and test the code
16
17
build :
17
- # The type of runner that the job will run on
18
18
runs-on : ubuntu-latest
19
19
20
- # Steps represent a sequence of tasks that will be executed as part of the job
21
20
steps :
22
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23
21
- uses : actions/checkout@v3
24
22
25
23
- uses : actions/setup-java@v3
@@ -47,14 +45,18 @@ jobs:
47
45
48
46
# Check that the docker image builds correctly
49
47
docker :
50
- # The type of runner that the job will run on
51
48
runs-on : ubuntu-latest
52
49
53
- # Steps represent a sequence of tasks that will be executed as part of the job
54
50
steps :
55
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
56
51
- uses : actions/checkout@v3
57
52
53
+ # Setup docker build environment
54
+ - name : Set up QEMU
55
+ uses : docker/setup-qemu-action@v2
56
+
57
+ - name : Set up Docker Buildx
58
+ uses : docker/setup-buildx-action@v2
59
+
58
60
- name : Cache Docker layers
59
61
uses : actions/cache@v3
60
62
with :
@@ -63,27 +65,25 @@ jobs:
63
65
restore-keys : |
64
66
${{ runner.os }}-buildx-
65
67
68
+ - name : Login to Container Registry
69
+ uses : docker/login-action@v2
70
+ with :
71
+ registry : ${{ env.REGISTRY }}
72
+ username : ${{ github.actor }}
73
+ password : ${{ secrets.GITHUB_TOKEN }}
74
+
75
+ - name : Lowercase image name
76
+ run : |
77
+ echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${IMAGE_NAME}" >>${GITHUB_ENV}
78
+
66
79
# Add Docker labels and tags
67
80
- name : Docker meta
68
81
id : docker_meta
69
82
uses : docker/metadata-action@v4
70
83
with :
71
84
images : ${{ env.DOCKER_IMAGE }}
72
85
73
- - name : Login to Docker Hub
74
- uses : docker/login-action@v2
75
- with :
76
- username : ${{ secrets.DOCKERHUB_USERNAME }}
77
- password : ${{ secrets.DOCKERHUB_TOKEN }}
78
-
79
- # Setup docker build environment
80
- - name : Set up QEMU
81
- uses : docker/setup-qemu-action@v2
82
-
83
- - name : Set up Docker Buildx
84
- uses : docker/setup-buildx-action@v2
85
-
86
- - name : Build
86
+ - name : Build docker image and push
87
87
uses : docker/build-push-action@v3
88
88
with :
89
89
context : .
95
95
# Use runtime labels from docker_meta as well as fixed labels
96
96
labels : |
97
97
${{ steps.docker_meta.outputs.labels }}
98
- maintainer=Bastiaan de Graaf <bastiaan @thehyve.nl>
99
- org.opencontainers.image.authors=Bastiaan de Graaf <bastiaan @thehyve.nl>
98
+ maintainer=Pim van Nierop <pim @thehyve.nl>
99
+ org.opencontainers.image.authors=Pim van Nierop <pim @thehyve.nl>
100
100
org.opencontainers.image.vendor=RADAR-base
101
101
org.opencontainers.image.licenses=Apache-2.0
102
102
0 commit comments