chore: deploy website to gh pages

This commit is contained in:
Maciej Jastrzębski
2023-01-18 22:13:08 +00:00
parent d86d353133
commit 42e79e6402
6 changed files with 41 additions and 125 deletions
-124
View File
@@ -1,124 +0,0 @@
version: 2.1
aliases:
- &filter-only-main
branches:
only:
- main
- &filter-ignore-main
branches:
ignore:
- main
defaults: &defaults
docker:
- image: cimg/node:current
working_directory: ~/react-native-testing-library
orbs:
codecov: codecov/codecov@3.2.2
jobs:
install-dependencies:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/react-native-testing-library
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile --no-progress --non-interactive --cache-folder ~/.cache/yarn
- save_cache:
key: dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- persist_to_workspace:
root: .
paths:
- .
lint-and-typescript:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
yarn lint
yarn typecheck
flow:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
yarn flow
tests:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: yarn test:ci
- store_artifacts:
path: coverage
destination: coverage
- codecov/upload
test-react-17:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
yarn test:ci:react:17
test-website:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
cd website && yarn install && yarn build
upload-code-coverage:
<<: *defaults
steps:
- codecov/upload:
file: coverage/coverage-final.json
deploy-website:
<<: *defaults
steps:
- checkout
- run:
name: Deploying to GitHub Pages
command: |
git config --global user.email "thymikee@users.noreply.github.com"
git config --global user.name "Michał Pierzchała"
echo "machine github.com login thymikee password $GITHUB_TOKEN" > ~/.netrc
cd website && yarn install && GIT_USER=thymikee yarn deploy
workflows:
version: 2
build-and-test:
jobs:
- install-dependencies
- lint-and-typescript:
requires:
- install-dependencies
- flow:
requires:
- install-dependencies
- tests:
requires:
- install-dependencies
- test-react-17:
requires:
- install-dependencies
- test-website:
requires:
- install-dependencies
# docusuarus build is running when deploying website as well
filters: *filter-ignore-main
- upload-code-coverage:
requires:
- tests
- deploy-website:
requires:
- install-dependencies
filters: *filter-only-main
+1 -1
View File
@@ -7,7 +7,7 @@ runs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
- name: Cache deps
id: yarn-cache
+37
View File
@@ -0,0 +1,37 @@
name: Deploy Website to GitHub Pages
on:
push:
branches:
- main
- 'chore/gh-actions-docs'
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js and deps
uses: ./.github/actions/setup-node-deps
- name: Build website
run: yarn 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: ./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
+2
View File
@@ -124,3 +124,5 @@ function flushMicrotasksQueue() {
return new Promise((resolve) => setImmediate(resolve));
}
```
1, 2, 3 MIC CHECK
+1
View File
@@ -10,6 +10,7 @@ const siteConfig = {
projectName: 'react-native-testing-library',
organizationName: 'callstack',
favicon: 'img/owl.png',
trailingSlash: false,
themeConfig: {
navbar: {
View File