-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 1.98 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "master" ]
paths-ignore:
- '.github/**'
- 'README.md'
- 'docs/**'
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
permissions:
contents: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Encoding
run: |
git config --global i18n.logoutputencoding utf-8
git config --global i18n.commitencoding utf-8
git config --global core.quotepath false
export LESSCHARSET=utf-8
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
# - name: Last Success SHA
# uses: nrwl/nx-set-shas@v3
# id: sha
# with:
# main-branch-name: "master"
- name: Build
run: |
rm -rf docs
docker build . -t temp_docs
docker run -itd --rm --name temp_docs temp_docs bash
docker cp temp_docs:/app/docs ./
- name: Push
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -n "$(git status -s docs)" ];then
git status
git config user.email "[email protected]"
git config user.name "Action Robot"
git add docs
git commit -m "Update Pages By Action Robot"
git push
fi