-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (35 loc) · 1.11 KB
/
docker-image.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
40
41
42
43
44
name: CI/CD Pipeline to Azure Web App
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
DB: ${{secrets.DB}}
CS: ${{secrets.CS}}
SFAKEY: ${{secrets.SFAKEY}}
SFAUSER: ${{secrets.SFA}}
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "^1.20"
- name: Build
run: |
go build -v ./...
- name: Log in to Docker Registry
run: echo ${{ secrets.DOCKER_P }} | docker login simfba.azurecr.io --username ${{ secrets.DOCKER_U }} --password-stdin
- name: Build Docker Image
run: docker build -t simfba.azurecr.io/simfba:${{ github.sha }} .
- name: Push Docker Image
run: docker push simfba.azurecr.io/simfba:${{ github.sha }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: "simfba"
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: "simfba.azurecr.io/simfba:${{ github.sha }}"