-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df978ae
commit 40ad3b0
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Reusable Docker container deployment to Google Cloud Run | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
container-name: | ||
required: true | ||
type: string | ||
tag: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Azure | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Azure Docker Login | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: ${{ secrets.ACR_REGISTRY_NAME }} | ||
username: ${{ secrets.ACR_USERNAME }} | ||
password: ${{ secrets.ACR_PASSWORD }} | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
docker build -t ${{ secrets.ACR_REGISTRY_NAME }}/${{ inputs.container-name }}:${{ inputs.tag }} . | ||
docker push ${{ secrets.ACR_REGISTRY_NAME }}/${{ inputs.container-name }}:${{ inputs.tag }} | ||
- name: Deploy to Azure App Service | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ github.event.repository.name }} | ||
slot-name: production | ||
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }} | ||
images: ${{ secrets.ACR_REGISTRY_NAME }}/${{ inputs.container-name }}:${{ inputs.tag }} |