Skip to content

Commit db3f797

Browse files
author
Alexander Scholz
committed
test
1 parent 82bf710 commit db3f797

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

.github/workflows/maven.yml

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,23 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Java CI with Maven
10-
11-
on:
12-
push:
13-
branches: ["main"]
14-
pull_request:
15-
branches: ["main"]
1+
name: Run Azure Login with OIDC
2+
on: [push]
163

174
permissions:
185
id-token: write
196
contents: read
20-
217
jobs:
22-
get-secret:
8+
build-and-deploy:
239
runs-on: ubuntu-latest
24-
2510
steps:
26-
- name: Checkout repository
27-
uses: actions/checkout@v4
28-
29-
- name: Azure Login
11+
- name: Azure login
3012
uses: azure/login@v2
3113
with:
3214
client-id: ${{ secrets.AZURE_CLIENT_ID }}
3315
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3416
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3517

36-
- name: Retrieve secret from Key Vault
37-
id: keyvault
38-
uses: azure/CLI@v2
18+
- name: Azure CLI script
19+
uses: azure/cli@v2
3920
with:
21+
azcliversion: latest
4022
inlineScript: |
41-
SECRET_VALUE=$(az keyvault secret show --name postgres-host --vault-name ${{ secrets.KEYVAULT_NAME }} --query value -o tsv)
42-
echo "::add-mask::$SECRET_VALUE"
43-
echo "SECRET_VALUE=$SECRET_VALUE" >> $GITHUB_ENV
44-
- name: Use retrieved secret
45-
run: echo "The secret is successfully retrieved!"
46-
47-
- name: Use SECRET_VALUE in deployment
48-
run: |
49-
./deploy.sh
50-
env:
51-
SECRET_VALUE: ${{ env.SECRET_VALUE }}
52-
build:
53-
runs-on: ubuntu-latest
54-
55-
steps:
56-
- uses: actions/checkout@v4
57-
- name: Set up JDK 21
58-
uses: actions/setup-java@v4
59-
with:
60-
java-version: "21"
61-
distribution: "temurin"
62-
cache: maven
63-
- name: Build with Maven
64-
run: mvn -B package --file pom.xml
23+
az account show

0 commit comments

Comments
 (0)