Skip to content

Commit 618cc1e

Browse files
authored
Create prodmain.yml
1 parent 3fdc9cc commit 618cc1e

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/prodmain.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: .NET CI_wtomaz808
2+
3+
env:
4+
registryName: onfp77x2viod4.azurecr.io
5+
repositoryName: techexcel/dotnetcoreapp
6+
dockerFolderPath: ./src/Application/src/RazorPagesTestSample
7+
tag: ${{ github.run_number }}
8+
9+
on:
10+
push:
11+
branches: [ main ]
12+
paths: src/Application/**
13+
pull_request:
14+
branches: [ main ]
15+
paths: src/Application/**
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
jobs:
20+
dockerBuildPush:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Docker Login
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ${{ secrets.ACR_LOGIN_SERVER }}
30+
username: ${{ secrets.ACR_USERNAME }}
31+
password: ${{ secrets.ACR_PASSWORD }}
32+
logout: true
33+
34+
- name: Docker Build
35+
run: docker build -t ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }} --build-arg build_version=${{ env.tag }} ${{ env.dockerFolderPath }}
36+
37+
- name: Docker Push
38+
run: docker push ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}
39+
40+
deploy-to-prod:
41+
runs-on: ubuntu-latest
42+
needs: dockerBuildPush
43+
environment:
44+
name: prod
45+
url: https://pickles808-prod.azurewebsites.net/
46+
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: 'Login via Azure CLI'
51+
uses: azure/[email protected]
52+
with:
53+
creds: ${{ secrets.AZURE_CREDENTIALS }}
54+
55+
- uses: azure/webapps-deploy@v2
56+
with:
57+
app-name: 'pickles808-prod'
58+
images: ${{ env.registryName }}/${{ env.repositoryName }}:${{ env.tag }}

0 commit comments

Comments
 (0)