-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathgithub-actions-file.yml
39 lines (29 loc) · 1.27 KB
/
github-actions-file.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Continuous Integration with Github Actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker Login - Azure Container Registry
uses: Azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
login-server: ${{ secrets.DOCKER_CONTAINER_REGISTRY }}
- name: Build Images
working-directory: ./20_RestWithASPNETUdemy_DeployToAzure/RestWithASPNETUdemy
run: docker-compose build
- name: Push to Azure Container registry
run: |
docker tag ${{ secrets.IMAGE_NAME }}:latest ${{ secrets.DOCKER_CONTAINER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${{github.run_id}}
docker push ${{ secrets.DOCKER_CONTAINER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${{github.run_id}}
- name: Login in Azure to Deployment
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure WebApp Container - Application Deployment
uses: azure/webapps-deploy@v2
with:
app-name: erudio-api-server
images: ${{ secrets.DOCKER_CONTAINER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${{github.run_id}}