-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (48 loc) · 2.04 KB
/
next_virtualmonitor-app(dev).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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: DEV - increment version and deploy
on:
push:
branches:
- next
jobs:
version-increment:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, '[DEPLOY]')"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GIT_SECRET }}
- run: git config --global user.name 'Digitransit'
- run: git config --global user.email 'digitransit@hsl.fi'
- name: major
run: npm version major -m "[DEPLOY] %s"
if: "contains(github.event.head_commit.message, '[MAJOR]')"
- name: minor
run: npm version minor -m "[DEPLOY] %s"
if: "contains(github.event.head_commit.message, '[MINOR]')"
- name: patch
run: npm version patch -m "[DEPLOY] %s"
if: "!contains(github.event.head_commit.message, '[MAJOR]') && !contains(github.event.head_commit.message, '[MINOR]')"
- run: git push
build-and-deploy:
runs-on: 'ubuntu-latest'
if: "startsWith(github.event.head_commit.message, '[DEPLOY]')"
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: azure/docker-login@v1
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.AzureAppService_ContainerUsername_43e4c8bef39f4f7d9da4f67dc0bafa48 }}
password: ${{ secrets.AzureAppService_ContainerPassword_60e925249e694d2896f1c2a466ddf37d }}
- run: |
docker build . -t index.docker.io/hsldevcom/digitransit-virtualmonitor:${{ github.sha }}
docker push index.docker.io/hsldevcom/digitransit-virtualmonitor:${{ github.sha }}
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'virtualmonitor-app'
slot-name: 'dev'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31939D05AD2E45D0B1860087F509D13E }}
images: 'index.docker.io/hsldevcom/digitransit-virtualmonitor:${{ github.sha }}'