Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make Directory header/footer match the marketing site #825

Merged
merged 23 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from 21 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
17 changes: 11 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ version: 2
updates:
# Maintain dependencies for npm
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
# Look for `package.json` and `package-lock.json` files in the root directory
directory: "/"
# Check for updates monthly
# Check for updates weekly
schedule:
interval: "daily"
interval: "weekly"
allow:
# Allow direct updates only (for packages named in package.json)
- dependency-type: "direct"
# Allow up to 10 open pull requests for npm dependencies
open-pull-requests-limit: 10
# Add dev team as reviewers
reviewers:
- "pressbooks/developers"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: "direct"
open-pull-requests-limit: 10
63 changes: 22 additions & 41 deletions .github/workflows/pipeline.yml → .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Tests
name: Run e2e Tests

on:
push:
branches: [ dev, master, v2 ]
branches: [dev, production]
tags:
- '*.*.*'
pull_request:
branches: [ dev, v2 ]
branches: [dev]

jobs:
testing:
runs-on: ubuntu-latest
container: cypress/browsers:node12.18.3-chrome87-ff82
name: Testing
e2e-tests:
runs-on: ubuntu-20.04
container: cypress/browsers:node16.16.0-chrome107-ff107
env:
VITE_ALGOLIA_APP_ID: ${{ secrets.VITE_ALGOLIA_APP_ID }}
VITE_ALGOLIA_API_READ_KEY: ${{ secrets.VITE_ALGOLIA_API_READ_KEY }}
Expand All @@ -20,51 +21,32 @@ jobs:
VITE_USER_NODE_ENV: ${{ secrets.VITE_USER_NODE_ENV }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2

- uses: actions/setup-node@v2
with:
node-version: '16'
uses: actions/checkout@v3

- name: Debug Env
run: |
echo ${{ secrets.VITE_ALGOLIA_APP_ID }}
echo ${{ secrets.VITE_ALGOLIA_API_READ_KEY }}
echo ${{ secrets.VITE_ALGOLIA_INDEX }}

- name: Install dependencies
run: |
node -v
npm i

- name: Lint
run: npm run lint

- uses: marceloprado/has-changed-path@v1
id: code-changes
with:
paths: src e2e
- name: Run e2e tests
uses: cypress-io/[email protected]

- name: e2e Tests
if: steps.code-changes.outputs.changed == 'true'
uses: cypress-io/github-action@v4
with:
start: npm run dev
wait-on: http://localhost:3001
browser: chrome

- name: Deploy to AWS Testing
uses: zulhfreelancer/[email protected]
if: github.ref == 'refs/heads/v2'
with:
aws-region: "ca-central-1"
aws-access-key: ${{ secrets.AWS_PIPELINE_ACCESS_KEY }}
aws-secret-key: ${{ secrets.AWS_PIPELINE_SECRET_KEY }}
pipeline-name: "v2_pressbooks_directory"
# - name: Deploy to AWS Testing
# uses: zulhfreelancer/[email protected]
# if: github.ref == 'refs/heads/v2'
# with:
# aws-region: "ca-central-1"
# aws-access-key: ${{ secrets.AWS_PIPELINE_ACCESS_KEY }}
# aws-secret-key: ${{ secrets.AWS_PIPELINE_SECRET_KEY }}
# pipeline-name: "v2_pressbooks_directory"

- name: Deploy to AWS Dev / Staging
- name: Deploy to AWS Dev
uses: zulhfreelancer/[email protected]
if: github.ref == 'refs/heads/dev'
with:
Expand All @@ -75,10 +57,9 @@ jobs:

- name: Deploy to AWS Production
uses: zulhfreelancer/[email protected]
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/production'
with:
aws-region: "ca-central-1"
aws-access-key: ${{ secrets.AWS_PIPELINE_PROD_ACCESS_KEY }}
aws-secret-key: ${{ secrets.AWS_PIPELINE_PROD_SECRET_KEY }}
pipeline-name: "pressbooks-directory"

pipeline-name: "pressbooks-directory"
40 changes: 40 additions & 0 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint & build assets

on:
push:
branches: [ dev, production ]
pull_request:
branches: [ dev, production ]

jobs:
lint-and-build:
runs-on: ubuntu-20.04
strategy:
matrix:
node: [ '16', '18' ]
name: Node ${{ matrix.node }}

steps:
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: |
node -v
npm ci

- name: Lint
run: npm run lint

- name: Build assets
run: npm run build --if-present
46 changes: 0 additions & 46 deletions e2e/fixtures/externalLinks.json

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/integration/bookCards.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('Book cards', function () {

cy.get(Elements.booksCards.cover)
.eq(3).find('img')
.should('have.attr', 'src')
.should('have.attr', 'data-src')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes test behaviour

.should('include', 'Math-for-Trades-Volume-1-COVER-STORE.jpg');
});
it('Lazy loading cover images', () => {
Expand Down
17 changes: 0 additions & 17 deletions e2e/integration/externalLinks.cy.js

This file was deleted.

Loading