Skip to content

Commit

Permalink
split pipeline into 2 jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Apr 17, 2024
1 parent a503e2e commit a097424
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/website_frontend_ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run Playwright Website Tests & Swap Slots if successful

on:
on:
workflow_run:
workflows: ["Deploy Website"]
types: [completed]
Expand All @@ -10,9 +10,10 @@ env:
WORKING_DIRECTORY: tests/web/Jordnaer.E2E.Tests
AZURE_WEBAPP_NAME: Jordnaer
RESOURCE_GROUP: Jordnaer

jobs:
playwright:
# Only run this if the workflow that triggered it was successful
# Only run this if the workflow that triggered it was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
container:
Expand All @@ -37,7 +38,18 @@ jobs:
Playwright_BaseUrl: "https://jordnaer-staging.azurewebsites.net/"
Playwright_Username: ${{ secrets.Playwright_Username }}
Playwright_Password: ${{ secrets.Playwright_Password }}


- name: Upload Screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: "${{ env.WORKING_DIRECTORY }}/bin/Release/screenshots"

swap-deployment:
needs: playwright
runs-on: ubuntu-latest
steps:
- name: Login to Azure
uses: azure/login@v2
with:
Expand All @@ -46,10 +58,3 @@ jobs:
- name: Swap Slots
run: >
az webapp deployment slot swap --name ${{ env.AZURE_WEBAPP_NAME }} --resource-group ${{ env.RESOURCE_GROUP }} --slot staging --target-slot production
- name: Upload Screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: "${{ env.WORKING_DIRECTORY }}/bin/Debug/screenshots"

0 comments on commit a097424

Please sign in to comment.