Skip to content

Commit

Permalink
new infra action
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiik91 committed Oct 25, 2024
1 parent d1e3d0a commit 087acdf
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 51 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/login_virtualmonitor-app(login-dev).yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/virtualmonitor-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 '[email protected]'
- 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: 'lwa-virtualmonitor-dev-weu'
publish-profile: ${{ secrets.AZURE_DEV_2024_PUBLISHPROFILE }}
images: 'index.docker.io/hsldevcom/digitransit-virtualmonitor:${{ github.sha }}'

0 comments on commit 087acdf

Please sign in to comment.