-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (46 loc) · 1.54 KB
/
push.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
name: Build and push Docker image
on:
release:
types: [published]
permissions:
id-token: write
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
steps:
- name: Checkout main project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
path: cdsi
- name: Set up JDK 17
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Docker cache
uses: ./cdsi/.github/workflows/dockercache
with:
dockerdir: cdsi/c/docker
imagename: cdsi-enclave-build
- name: 'Az CLI login'
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d # v1.6.1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Docker login'
run:
az acr login --name ${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}
- name: Build and push container image
working-directory: cdsi
run: |
./mvnw -e -B deploy \
-P-build-dev-enclave \
-Dpackaging=docker \
-Djib.to.image="${{ secrets.REGISTRY_LOGIN_SERVER }}/cdsi:${GITHUB_REF_NAME}"