Skip to content

Commit 9fd3a82

Browse files
authored
Merge pull request #8 from susom/development
Add deployment github action
2 parents eaffcd9 + 182a09b commit 9fd3a82

File tree

2 files changed

+73
-3
lines changed

2 files changed

+73
-3
lines changed

.github/workflows/deployment.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
- main
8+
9+
jobs:
10+
deployment:
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: ${{ github.ref_name }}
14+
concurrency: ${{ github.ref_name }}
15+
16+
permissions:
17+
contents: 'read'
18+
id-token: 'write'
19+
20+
env:
21+
IMAGE: mirc-ctp
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Authenticate with Google Cloud
28+
uses: google-github-actions/auth@v2
29+
with:
30+
project_id: ${{ secrets.WORKLOAD_IDENTITY_PROJECT }}
31+
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
32+
33+
- name: Set up Cloud SDK
34+
uses: 'google-github-actions/setup-gcloud@v2'
35+
with:
36+
version: '>= 363.0.0'
37+
38+
- name: Configure docker for Google artifact registry
39+
id: docker
40+
run: |
41+
gcloud auth configure-docker ${{ vars.REGISTRY }}
42+
branch=${GITHUB_REF##*/}
43+
ts=$(date +%Y%m%d%H%M%S)
44+
echo "BUILD_ID=${branch}-${ts}" >> $GITHUB_OUTPUT
45+
echo "BRANCH_NAME=${branch}" >> $GITHUB_OUTPUT
46+
47+
- name: Setup buildx so we can use GHA caching
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Setup Java
51+
uses: actions/setup-java@v4
52+
with:
53+
java-version: '8'
54+
distribution: 'temurin'
55+
56+
- name: Run make
57+
run: make install
58+
59+
- name: Build and push image
60+
uses: docker/build-push-action@v6
61+
with:
62+
context: .
63+
cache-from: type=gha
64+
cache-to: type=gha,mode=max
65+
push: true
66+
tags: |
67+
${{ vars.REGISTRY }}/${{ secrets.REPOSITORY }}/${{ env.IMAGE }}:${{ steps.docker.outputs.BUILD_ID }}
68+
${{ vars.REGISTRY }}/${{ secrets.REPOSITORY }}/${{ env.IMAGE }}:${{ github.sha }}
69+
${{ vars.REGISTRY }}/${{ secrets.REPOSITORY }}/${{ env.IMAGE }}:${{ steps.docker.outputs.BRANCH_NAME }}
70+
${{ vars.REGISTRY }}/${{ secrets.REPOSITORY }}/${{ env.IMAGE }}:latest

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Dockerfile for running CTP DicomAnonymizerTool with required dependencies
2-
FROM openjdk:8
2+
FROM eclipse-temurin:8
33

4-
ENV HOME /app
4+
ENV HOME=/app
55

66
WORKDIR /app
77
ADD DAT /app/DAT
88
ADD lib /app/lib
99
ADD DicomAnonymizerTool/source/files/log4j.properties /app
1010

11-
WORKDIR /usr/local/openjdk-8
11+
WORKDIR /opt/java/openjdk
1212
RUN chmod +x /app/lib/*.bin
1313
RUN echo yes | /app/lib/jai-1_1_3-lib-linux-amd64-jdk.bin
1414
RUN echo yes | /app/lib/jai_imageio-1_1-lib-linux-amd64-jdk.bin

0 commit comments

Comments
 (0)