Skip to content

Commit

Permalink
Merge pull request #585 from NYPL/NO-REF/fix-playwright-yml
Browse files Browse the repository at this point in the history
NO-REF: Fix Playwright env setting step
  • Loading branch information
jackiequach authored Jan 13, 2025
2 parents 5e3b2ea + d3c4aa2 commit c5f96d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/Playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
default: "http://local.nypl.org:3000/"
required: false
type: string
pull_request:

jobs:
tests:
Expand All @@ -25,15 +24,11 @@ jobs:
- name: Set environment for branch
run: |
touch .env
if [[ "${{ github.event.inputs.base_url }}" != '' ]]; then
echo "BASE_URL=${{ github.event.inputs.base_url }}" >> .env
else
echo "BASE_URL=http://local.nypl.org:3000/" >> .env
fi
echo "BASE_URL=${{ inputs.base_url }}" >> .env
shell: bash

- name: Add hosts to /etc/hosts
if: github.event_name == 'pull_request'
if: inputs.base_url == 'http://local.nypl.org:3000/'
run: |
sudo echo "127.0.0.1 local.nypl.org" | sudo tee -a /etc/hosts
Expand All @@ -47,7 +42,7 @@ jobs:
run: NODE_ENV=test npm run build

- name: Start the app
if: github.event_name == 'pull_request'
if: inputs.base_url == 'http://local.nypl.org:3000/'
run: |
NODE_ENV=test npm start &
sleep 5
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,9 @@ jobs:
run: |
docker build --build-arg airtable_api_key=$AIRTABLE_KEY \
--build-arg APP_ENV=$APP_ENV .
playwright_tests:
uses: NYPL/sfr-bookfinder-front-end/.github/workflows/Playwright.yml@main
secrets: inherit
with:
base_url: "http://local.nypl.org:3000/"
2 changes: 1 addition & 1 deletion .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Full CI/CD Pipeline
name: Rollback Production

on:
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Prerelease]

- Add rollback step to ci/cd yml file
- Update Playwright.yml step for setting env

## [0.18.13]

Expand Down

0 comments on commit c5f96d8

Please sign in to comment.