Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit c79da9d

Browse files
author
Zaid
authored
workflows: add docs deploy workflow (#34)
1 parent c440063 commit c79da9d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
docs:
8+
name: Deploy Docs
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v2
13+
14+
- name: Install Node v15
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 15
18+
19+
- name: Install pnpm
20+
run: curl -L https://unpkg.com/@pnpm/self-installer | node
21+
22+
- name: Use node_modules cache
23+
uses: actions/cache@v2
24+
with:
25+
path: '**/node_modules'
26+
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
27+
28+
- name: Install deps
29+
run: pnpm i
30+
31+
- name: Build the code
32+
run: pnpm run build
33+
34+
- name: Build the docs
35+
run: pnpm run docs
36+
37+
- name: Commit the Docs
38+
uses: cpina/github-action-push-to-another-repository@master
39+
env:
40+
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
41+
with:
42+
source-directory: 'doc'
43+
destination-github-username: 'github-actions[bot]'
44+
destination-repository-username: "cordis-lib"
45+
destination-repository-name: 'cordis-lib.github.io'
46+
target-branch: 'main'
47+
user-email: 41898282+github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)