-
Notifications
You must be signed in to change notification settings - Fork 41
102 lines (98 loc) · 2.86 KB
/
admin.yaml
File metadata and controls
102 lines (98 loc) · 2.86 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Admin App CI/CD
permissions:
id-token: write
on:
push:
paths:
- 'admin/**'
- '2wr-app/public/images/**'
- 'TwoWeeksReady.Common/**'
- '.github/workflows/admin.yaml'
branches: [ main ]
pull_request:
paths:
- 'admin/**'
- '2wr-app/public/images/**'
- '.github/workflows/admin.yaml'
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build -c Release
working-directory: ./admin
- name: Publish
run: dotnet publish -c Release
working-directory: ./admin
- name: Zip Functions Package
run: zip -r ../deploy.zip ./
working-directory: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/publish/
- name: Upload Deployment Zip
uses: actions/upload-artifact@v2
with:
name: deployment_zip
path: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/deploy.zip
- name: Upload Deployment Script
uses: actions/upload-artifact@v2
with:
name: deployment_script
path: ./az/deploy-admin-app.sh
deploy_to_dev:
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request'
environment: development
steps:
- name: Download a Deployment Zip
uses: actions/download-artifact@v2
with:
name: deployment_zip
- name: Download a Deployment Script
uses: actions/download-artifact@v2
with:
name: deployment_script
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Azure Deploy Resources
uses: Azure/cli@v1.0.0
with:
inlineScript: |
chmod +x ./deploy-admin-app.sh
./deploy-admin-app.sh -z deploy.zip
deploy_to_beta:
runs-on: ubuntu-latest
needs: deploy_to_dev
if: github.event_name != 'pull_request'
environment: beta
steps:
- name: Download a Deployment Zip
uses: actions/download-artifact@v2
with:
name: deployment_zip
- name: Download a Deployment Script
uses: actions/download-artifact@v2
with:
name: deployment_script
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Azure Deploy Resources
uses: Azure/cli@v1.0.0
with:
inlineScript: |
chmod +x ./deploy-admin-app.sh
./deploy-admin-app.sh -z deploy.zip -r 2wr-beta-resources -e 2wrbeta