This repository was archived by the owner on Oct 21, 2024. It is now read-only.
use GitHub Actions to build and deploy image #5
This file contains hidden or 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 to ACR | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: 'Build and Push to ACR' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }} | |
| username: ${{ secrets.DOCKER_REGISTRY_SERVER_USERNAME }} | |
| password: ${{ secrets.DOCKER_REGISTRY_SERVER_PASSWORD }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image to ACR | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/kantega-big-agi:latest | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: 'kantega-big-agi' | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
| images: '${{ secrets.DOCKER_REGISTRY_SERVER_URL }}/kantega-big-agi:latest' |