This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
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: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- backend | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: gradlew 실행 권한 | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew bootjar | |
- name: Log in with Azure | |
uses: azure/login@v1 | |
with: | |
creds: '${{ secrets.AZURE_CREDENTIALS }}' | |
- name: Log in to ACR | |
run: echo "${{ secrets.AZURE_CLIENT_SECRET }}" | docker login fiveselves.azurecr.io -u ${{ secrets.AZURE_CLIENT_ID }} --password-stdin | |
- run: | | |
docker build . -t fiveselves.azurecr.io/five:latest | |
docker push fiveselves.azurecr.io/five:latest | |
- name: Deploy Container App to Azure | |
uses: azure/container-apps-deploy-action@v1 | |
with: | |
imageToDeploy: fiveselves.azurecr.io/five:latest |