Skip to content

Commit

Permalink
refactor(deploy): restructure GitHub Actions workflow for front and b…
Browse files Browse the repository at this point in the history
…ack builds
  • Loading branch information
endersonmenezes committed Dec 2, 2024
1 parent 393d73a commit 7d33aa5
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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: Build and deploy Node.js app to Azure Web App - devpr

on:
Expand All @@ -10,11 +7,11 @@ on:
workflow_dispatch:

jobs:
build:
build-deploy-front:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # needed for provenance data generation
id-token: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
Expand All @@ -27,7 +24,6 @@ jobs:
version: 9.12.1

- name: Install Node
# Cache node_modules
uses: actions/setup-node@v4
with:
node-version: 20
Expand All @@ -46,6 +42,15 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/apps/devmx/browser

build-back:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: |
docker build -t devmx-server -f Dockerfile.server .
Expand All @@ -60,13 +65,12 @@ jobs:
- name: Push Docker image to Azure Container Registry
run: docker push devmx.azurecr.io/devmx-server:${{ github.sha }}

deploy:
deploy-back:
runs-on: ubuntu-latest
needs: build
needs: build-back
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Login to Azure Container Registry
uses: azure/docker-login@v1
Expand Down

0 comments on commit 7d33aa5

Please sign in to comment.