Skip to content

chore: deploy website to GH pages #1282

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

Merged
merged 5 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
124 changes: 0 additions & 124 deletions .circleci/config.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup deps
description: Setup Node.js and install dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache deps
id: yarn-cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}

- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
name: Setup
description: Setup Node.js and install dependencies
name: Setup Website deps
description: Setup Node.js and install website dependencies

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Cache deps
id: yarn-cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}

- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash
node-version: 18

- name: Cache website deps
id: yarn-cache-website
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Website

on:
push:
branches:
- main

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and website deps
uses: ./.github/actions/setup-website-deps

- name: Build website
run: yarn --cwd website build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./website/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
29 changes: 14 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,68 @@ on:
branches: ['**']

jobs:
install-cached-deps:
install-cache-deps:
runs-on: ubuntu-latest
name: Install and Cache deps
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

lint:
needs: [install-cached-deps]
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

- name: Lint
run: yarn lint

typecheck:
needs: [install-cached-deps]
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Typecheck
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

- name: Typecheck
run: yarn typecheck

flow:
needs: [install-cached-deps]
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Flow
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

- name: Flow
run: yarn flow

test:
needs: [install-cached-deps]
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test React 18
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

- name: Test React 18
run: yarn test:ci
Expand All @@ -76,29 +76,28 @@ jobs:
uses: codecov/codecov-action@v2

test-react-17:
needs: [install-cached-deps]
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test React 17
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
uses: ./.github/actions/setup-deps

- name: Test React 17
run: yarn test:ci:react:17

test-website:
needs: [install-cached-deps]
runs-on: ubuntu-latest
name: Test Website
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
- name: Setup Node.js and website deps
uses: ./.github/actions/setup-website-deps

- name: Build website
run: yarn --cwd website build
1 change: 1 addition & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const siteConfig = {
projectName: 'react-native-testing-library',
organizationName: 'callstack',
favicon: 'img/owl.png',
trailingSlash: false,

themeConfig: {
navbar: {
Expand Down
Empty file added website/static/.nojekyll
Empty file.