Skip to content

Commit 5a51ca6

Browse files
authored
ci: deploy website to GitHub Pages
- Remove Angular application - Add Docusaurus website - Configure Docusaurus website - Add website CI workflow - Configure GitHub Pages - Deploy to GitHub Pages when triggered from `main` branch
2 parents 46ecb00 + 0713c53 commit 5a51ca6

File tree

87 files changed

+10183
-14906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+10183
-14906
lines changed

.angulardoc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/website.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "NgRx Essentials website"
2+
3+
env:
4+
NODE_OPTIONS: --max_old_space_size=6144
5+
node-version: 14.x
6+
website-package-name: website
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request: {}
13+
14+
jobs:
15+
build:
16+
name: Build website
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js ${{ env.node-version }}
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ env.node-version }}
25+
26+
- name: Variable-Yarn cache directory path
27+
id: yarn-cache-dir-path
28+
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
- name: Cache Yarn cache directory
30+
uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+
key: ${{ runner.os }}-node-${{ env.node-version }}-yarn-${{ hashFiles('yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-node-${{ env.node-version }}
36+
${{ runner.os }}
37+
- run: yarn install
38+
- name: Build website
39+
run: yarn build
40+
- name: "Upload website build artifact"
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: ${{ env.website-package-name }}
44+
path: ./build/
45+
if-no-files-found: error
46+
47+
deploy:
48+
name: Deploy website to GitHub Pages
49+
if: >
50+
github.ref == 'refs/heads/main' && (github.event_name ==
51+
'workflow_dispatch' || github.event_name == 'push')
52+
needs: build
53+
runs-on: ubuntu-latest
54+
55+
env:
56+
package-path: ./static-website/
57+
58+
steps:
59+
# necessary for JamesIves/github-pages-deploy-action
60+
- uses: actions/checkout@v2
61+
62+
- uses: actions/download-artifact@v2
63+
with:
64+
name: ${{ env.website-package-name }}
65+
path: ${{ env.package-path }}
66+
67+
- name: Deploy docs to GitHub Pages
68+
uses: JamesIves/github-pages-deploy-action@releases/v4
69+
with:
70+
branch: gh-pages
71+
folder: ${{ env.package-path }}

.gitignore

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,20 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
2-
3-
# compiled output
4-
/dist
5-
/tmp
6-
/out-tsc
7-
# Only exists if Bazel was run
8-
/bazel-out
9-
10-
# dependencies
1+
# Dependencies
112
/node_modules
123

13-
# profiling files
14-
chrome-profiler-events*.json
15-
speed-measure-plugin*.json
16-
17-
# IDEs and editors
18-
/.idea
19-
.project
20-
.classpath
21-
.c9/
22-
*.launch
23-
.settings/
24-
*.sublime-workspace
4+
# Production
5+
/build
256

26-
# IDE - VSCode
27-
.vscode/*
28-
!.vscode/settings.json
29-
!.vscode/tasks.json
30-
!.vscode/launch.json
31-
!.vscode/extensions.json
32-
.history/*
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
3310

34-
# misc
35-
/.sass-cache
36-
/connect.lock
37-
/coverage
38-
/libpeerconnection.log
39-
npm-debug.log
40-
yarn-error.log
41-
testem.log
42-
/typings
43-
44-
# System Files
11+
# Misc
4512
.DS_Store
46-
Thumbs.db
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
# NgrxTutorial
1+
# Website
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.2.
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
44

5-
## Development server
5+
### Installation
66

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
```
8+
$ yarn
9+
```
810

9-
## Code scaffolding
11+
### Local Development
1012

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
13+
```
14+
$ yarn start
15+
```
1216

13-
## Build
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1418

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
19+
### Build
1620

17-
## Running unit tests
21+
```
22+
$ yarn build
23+
```
1824

19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2026

21-
## Running end-to-end tests
27+
### Deployment
2228

23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
29+
```
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
2432

25-
## Further help
26-
27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

angular.json

Lines changed: 0 additions & 139 deletions
This file was deleted.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

browserslist

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/assets/content/chapters/chapter-1.md renamed to docs/chapter-1.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# Chapter 1: Introduction to NgRx
1+
---
2+
title: "Chapter 1: Introduction to NgRx"
3+
sidebar_position: 1
4+
---
25

36
## Preface
47

5-
*This tutorial was created and is maintained by Armen Vardanyan, an Angular/NgRx enthusiast just like you. The project is open sourced, read about how you can also contribute to is here*
8+
_This tutorial was created and is maintained by Armen Vardanyan, an Angular/NgRx enthusiast just like you. The project is open sourced, read about how you can also contribute to is here_
69

710
I want to help people master skills necessary for WebDev as quick as possible, so I won't be using big words and long introductions here. Just a few sentences about this tutorial
811

912
### What will you learn?
1013

11-
After you complete this tutorial, you will
14+
After you complete this tutorial, you will
1215

1316
1. Know the basic and advanced concepts of NgRx
1417
2. Be able to create applications using NgRx
@@ -22,9 +25,9 @@ I hold a firm belief that in order to learn and understand something thoroughly,
2225

2326
### How is this tutorial structured?
2427

25-
The tutorial is divided into simple chapters (you are, as you've noticed, reading Chapter 1 right now). After you finish a chapter, you can move on to the next one.
28+
The tutorial is divided into simple chapters (you are, as you've noticed, reading Chapter 1 right now). After you finish a chapter, you can move on to the next one.
2629
Each chapter explores one single, isolated topic, with small examples, and then puts it into use in the application that we are building.
2730

2831
### What's next?
2932

30-
Now, that we know what and why we are doing, let's move on to Chapter 2, where we will actually start doing stuff.
33+
Now, that we know what and why we are doing, let's move on to Chapter 2, where we will actually start doing stuff.

0 commit comments

Comments
 (0)