-
Notifications
You must be signed in to change notification settings - Fork 15
60 lines (56 loc) · 1.99 KB
/
deploy-quarkus-native.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
60
name: Build and deploy Quarkus native image
on:
push:
branches: [main]
workflow_dispatch:
paths:
- .github/workflows/*.yml
- quarkus-app/**
env:
# Replace with your registry URL
REGISTRY_URL: crjavaruntimessinedied.azurecr.io
PROJECT: java-runtimes
RESOURCE_GROUP: rg-java-runtimes
jobs:
build-native:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build quarkus-app with GraalVM
run: |
cd quarkus-app && ./mvnw -Pnative package -Dquarkus.native.container-build=true
- name: Build quarkus-app native Docker image
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/quarkus-app-native:${{ github.sha }}
file: ./quarkus-app/src/main/docker/Dockerfile.native
context: ./quarkus-app/
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy quarkus-app native Docker image to Azure Container Apps
uses: azure/CLI@v1
with:
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
az containerapp update \
--name quarkus-app \
--resource-group ${{ env.RESOURCE_GROUP }} \
--image ${{ env.REGISTRY_URL }}/${{ env.PROJECT }}/quarkus-app-native:${{ github.sha }} \
--query "properties.configuration.ingress.fqdn" \
--output tsv