This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
64 lines (55 loc) · 2.07 KB
/
tt-website.cicd.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: TailwindTraders Website Pipelines
on:
push:
branches: [main, ]
paths:
- 'TailwindTraders.Website/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 0 * * *'
jobs:
pr-build:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Docker build
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
main-build:
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.merged == true) }}
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Docker build
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
nightly-build-and-deploy:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_2 }}
- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker build and push
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
docker push tailwindtraders/web:gh-${{ github.sha }}
- uses: azure/webapps-deploy@v2
with:
app-name: ${{ secrets.CONTAINER_APPSERVICE_NAME }}
images: 'tailwindtraders/web:gh-${{ github.sha }}'