Merge pull request #45 from luisferrarezi/readmefase5 #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy app Tiu Lanches | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4.1.0 | |
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/checkout@v4.1.1 | |
- name: Cria ConfigMap | |
run: | | |
touch tiulanches-config.yaml | |
cat > tiulanches-config.yaml << __EOF__ | |
${{ secrets.CONFIG_MAP_YAML }} | |
__EOF__ | |
- name: Azure Login | |
uses: Azure/login@v2.0.0 | |
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/k8s-deploy@v4.9 | |
with: | |
manifests: | | |
tiulanches-config.yaml | |
kubernetes/azure/tiulanches-deployment.yaml |