fix: spelling error in README.md
This commit is contained in:
1 parent
4359d9cd1b
commit
c9f7f11e2d
1 file changed
+54
-54
@@ -11,12 +11,12 @@ View site: https://angulareportfolio.pw
|
||||
- Package - view [`package.json`]
|
||||
## Requirements
|
||||
[Hexo] is a [SSG] powered by [NodeJS][node]. So we'll need this first:
|
||||
- Node JS environment
|
||||
- Node JS environment
|
||||
- [npm] (package manager)
|
||||
- [git] core
|
||||
## Script
|
||||
We already have a Node image on [Docker Library][docker-lib], so we'll require it to run our script on the
|
||||
environment of NodeJS.
|
||||
We already have a Node image on [Docker Library][docker-lib], so we'll require it to run our script on the
|
||||
environment of NodeJS.
|
||||
|
||||
This will bring `npm` and `git` core with it: `image: node:latest`
|
||||
|
||||
@@ -34,13 +34,13 @@ We'll set the the `npm` modules and its dependecies as a `cache` to speed up our
|
||||
|
||||
```yaml
|
||||
cache:
|
||||
paths:
|
||||
paths:
|
||||
- node_modules/
|
||||
```
|
||||
### GitLab-CI
|
||||
We need to prepare our `gitlab-ci.yml` configuration file to do as we described previously.
|
||||
|
||||
We'll also need a `pages` job and finally a `public` folder with our `artifacts`, afecting only our `master` branch:
|
||||
We'll also need a `pages` job and finally a `public` folder with our `artifacts`, affecting only our `master` branch:
|
||||
<br>
|
||||
|
||||
```yaml
|
||||
@@ -48,7 +48,7 @@ We'll also need a `pages` job and finally a `public` folder with our `artifacts`
|
||||
image: node:latest
|
||||
# add 'node_modules' to cache for speeding up builds
|
||||
cache:
|
||||
paths:
|
||||
paths:
|
||||
- node_modules/ # Node modules and dependencies
|
||||
before_script:
|
||||
- npm install -g hexo-cli # Install Hexo itself
|
||||
@@ -63,7 +63,7 @@ pages:
|
||||
- hexo generate # Hexo generate Static Site
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
only:
|
||||
- master # this job will affect only the 'master' branch
|
||||
```
|
||||
@@ -77,7 +77,7 @@ build website:
|
||||
image: node:latest
|
||||
# add 'node_modules' to cache for speeding up builds
|
||||
cache:
|
||||
paths:
|
||||
paths:
|
||||
- node_modules/ # Node modules and dependencies
|
||||
script:
|
||||
- npm install -g hexo-cli # Install Hexo itself
|
||||
@@ -107,49 +107,49 @@ In case you want to deploy your website via GitHub Action, here are some of the
|
||||
name: Hexo Blog CI
|
||||
|
||||
# master branch on push, auto run
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
||||
jobs:
|
||||
build-hexo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
build-hexo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# check it to your workflow can access it
|
||||
# from: https://github.com/actions/checkout
|
||||
- name: Checkout Repository master branch
|
||||
uses: actions/checkout@master
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
- name: Setup Node.js 10.x
|
||||
uses: actions/checkout@master
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
- name: Setup Node.js 10.x
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: "10.x"
|
||||
|
||||
|
||||
- name: Setup Hexo Dependencies
|
||||
run: |
|
||||
npm install hexo-cli -g
|
||||
npm install
|
||||
|
||||
|
||||
- name: Setup Deploy Private Key
|
||||
env:
|
||||
HEXO_DEPLOY_PRIVATE_KEY: ${{ secrets.HEXO_DEPLOY_PRIVATE_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
|
||||
|
||||
- name: Setup Git Infomation
|
||||
run: |
|
||||
git config --global user.name '名字'
|
||||
run: |
|
||||
git config --global user.name '名字'
|
||||
git config --global user.email '邮件'
|
||||
- name: Deploy Hexo
|
||||
- name: Deploy Hexo
|
||||
run: |
|
||||
hexo clean
|
||||
hexo generate
|
||||
hexo generate
|
||||
hexo deploy
|
||||
```
|
||||
|
||||
@@ -164,7 +164,7 @@ jobs:
|
||||
steps:
|
||||
- name: 🚚 Get latest code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
||||
- name: 📂 Sync files
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.1.0
|
||||
with:
|
||||
@@ -181,65 +181,65 @@ jobs:
|
||||
name: Hexo Blog CI
|
||||
|
||||
# master branch on push, auto run
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
||||
jobs:
|
||||
build-hexo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
build-hexo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# check it to your workflow can access it
|
||||
# from: https://github.com/actions/checkout
|
||||
- name: Checkout Repository master branch
|
||||
uses: actions/checkout@master
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
- name: Setup Node.js 10.x
|
||||
uses: actions/checkout@master
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
- name: Setup Node.js 10.x
|
||||
uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: "10.x"
|
||||
|
||||
|
||||
- name: Setup Hexo Dependencies
|
||||
run: |
|
||||
npm install hexo-cli -g
|
||||
npm install
|
||||
|
||||
|
||||
- name: Setup Deploy Private Key
|
||||
env:
|
||||
HEXO_DEPLOY_PRIVATE_KEY: ${{ secrets.HEXO_DEPLOY_PRIVATE_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
|
||||
|
||||
- name: Setup Git Infomation
|
||||
run: |
|
||||
git config --global user.name 'Leon Xu'
|
||||
run: |
|
||||
git config --global user.name 'Leon Xu'
|
||||
git config --global user.email 'dcwinfield362@gmail.com'
|
||||
- name: Deploy Hexo
|
||||
- name: Deploy Hexo
|
||||
run: |
|
||||
hexo clean
|
||||
hexo generate
|
||||
hexo generate
|
||||
hexo deploy
|
||||
- name: Upload result from build job
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: public
|
||||
path: /public
|
||||
deploy-to-website:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
deploy-to-website:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# check it to your workflow can access it
|
||||
# from: https://github.com/actions/checkout
|
||||
- name: Get latest code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
|
||||
# from: https://github.com/actions/setup-node
|
||||
- name: Sync files
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.1.0
|
||||
with:
|
||||
@@ -251,18 +251,18 @@ jobs:
|
||||
```
|
||||
|
||||
### Testing our builds before pushing content to the `master` branch
|
||||
What if we want to test our builds in another branch before afecting `master`?
|
||||
What if we want to test our builds in another branch before afecting `master`?
|
||||
We'll just need to set a `test` job to do this for us:
|
||||
<br>
|
||||
|
||||
```yaml
|
||||
image: node:latest
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
paths:
|
||||
- node_modules/
|
||||
before_script:
|
||||
- npm install -g hexo-cli
|
||||
- npm install
|
||||
- npm install -g hexo-cli
|
||||
- npm install
|
||||
# add a job called 'test'
|
||||
test:
|
||||
stage: test
|
||||
@@ -277,7 +277,7 @@ pages:
|
||||
- hexo generate
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
- public
|
||||
only:
|
||||
- master # this job will affect only the 'master' branch
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user