Skip to content

Merge pull request #22 from luisferrarezi/ajuste3 #13

Merge pull request #22 from luisferrarezi/ajuste3

Merge pull request #22 from luisferrarezi/ajuste3 #13

Workflow file for this run

name: Deploy app Tiu Lanches
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/[email protected]
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Build with Maven
run: mvn clean package
- name: ACR Login
uses: Azure/docker-login@v1
with:
username: ${{ secrets.USERNAME_ACR }}
password: ${{ secrets.PASSWORD_ACR }}
login-server: ${{ secrets.SERVER_ACR }}
- run: |
docker build . -t tiulanchesacr.azurecr.io/tiulanches:latest
docker push tiulanchesacr.azurecr.io/tiulanches:latest
deploy-aks:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Cria ConfigMap
run: |
touch configmap.yaml
cat > configmap.yaml << __EOF__
${{ secrets.CONFIG_MAP_YAML }}
__EOF__
- name: Azure Login
uses: Azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v3
with:
resource-group: ${{ secrets.RESOURSE_GROUP }}
cluster-name: ${{ secrets.CLUSTER_NAME }}
subscription: ${{ secrets.SUBSCRIPTION }}
- name: Deploy to Kubernetes cluster
uses: Azure/[email protected]
with:
manifests: |
configmap.yaml
kubernetes/azure/app-deployment.yaml