forked from simwrapper/simwrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.23 KB
/
deploy-to-staging.yml
File metadata and controls
42 lines (39 loc) · 1.23 KB
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
name: Remote Deploy Staging to GitHub Pages
on:
push:
branches:
- staging
repository_dispatch:
jobs:
# Run playwright e2e tests first:
e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install dependencies
run: cd ${{ github.workspace }} && npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test --workers=2
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
# Ping staging build -IF- tests passed
notify-staging:
needs: e2e-tests
runs-on: ubuntu-latest
steps:
- name: PING staging
if: github.event.action != 'pong'
run: |
curl -X POST https://api.github.com/repos/simwrapper/staging/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.BUILD_STAGING }} \
--data '{"event_type": "ping", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'" }}'