Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 6 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,49 +41,15 @@ jobs:

deploy_dev:
name: Deploy Dev
runs-on: ubuntu-latest
needs: build
environment: dev
uses: ./github/workflows/step-deploy.yml
with:
env: dev

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dometrain-artifact
path: artifacts/

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: app-dometrain-github-actions-erisjakupi-dev
package: artifacts/

deploy_prod:
name: Deploy Prod
runs-on: ubuntu-latest
needs: deploy_dev
environment: prod

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dometrain-artifact
path: artifacts/

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.PROD_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.PROD_AZURE_SUBSCRIPTION_ID }}

- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
uses: ./github/workflows/step-deploy.yml
with:
env: prod
42 changes: 42 additions & 0 deletions .github/workflows/step-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Step - Deploy"

on:
workflow_call:
inputs:
env:
required: true
type: string
secrets:
AZURE_CLIENT_ID:
required: true
AZURE_TENANT_ID:
required: true
AZURE_SUBSCRIPTION_ID:
required: true

jobs:
deploy:
name: Deploy ${{ inputs.env}}
runs-on: ubuntu-latest
environment: dev

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dometrain-artifact
path: artifacts/

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: app-dometrain-github-actions-erisjakupi-${{ inputs.env }}
package: artifacts/