Skip to content

Commit

Permalink
continuous deploy?
Browse files Browse the repository at this point in the history
  • Loading branch information
AgFlore committed Apr 25, 2024
1 parent 1187c9f commit 52944fd
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ name: Build and Push Docker Image
on:
push:
branches:
- main
- master
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ $default-branch ]

env:
# Use docker.io for Docker Hub if empty
Expand Down Expand Up @@ -59,6 +57,12 @@ jobs:
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha,format=long
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand All @@ -72,3 +76,20 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.AZUREAPPSERVICE_APP_NAME }}
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_a553084ece9e4846b9201486ab46a4c2 }}
images: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}'

0 comments on commit 52944fd

Please sign in to comment.