forked from bacalhau-project/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 1.98 KB
/
publish.yaml
File metadata and controls
68 lines (65 loc) · 1.98 KB
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
64
65
66
67
68
name: publish
on: [push]
jobs:
render-ipynb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: make convert
- name: Archive rendered artifacts
uses: actions/upload-artifact@v3
with:
name: rendered
path: |
rendered
test-docusaurus:
runs-on: ubuntu-latest
needs: render-ipynb
steps:
- name: Checkout Docs
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/docs.bacalhau.org
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: $(yarn cache dir)"
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Download rendered files
uses: actions/download-artifact@v3
with:
name: rendered
path: rendered
- name: Copy Files
run: cp -r rendered/* docs/examples
- run: yarn install --frozen-lockfile
- run: yarn build
publish:
runs-on: ubuntu-latest
needs: test-docusaurus
if: github.ref == 'refs/heads/main'
steps:
- name: Download rendered files
uses: actions/download-artifact@v3
with:
name: rendered
- uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: "."
destination-github-username: "bacalhau-project"
destination-repository-name: "docs.bacalhau.org"
user-email: examples@bacalhau-project
target-branch: main
target-directory: docs/examples
commit-message: "bot(examples): ${{ github.event.head_commit.message }} via ${{ github.event.head_commit.url }}"