Skip to content

Commit c44526a

Browse files
committed
added two workflows
1 parent a1b3c2c commit c44526a

2 files changed

Lines changed: 52 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Knative Tutorial Site
1+
name: Knative Tutorial
22

33
on:
44
push:
55
branches:
6-
- master
6+
- release/0.7.x
77
env:
88
SITE_DIR: 'gh-pages'
99
jobs:
@@ -16,7 +16,7 @@ jobs:
1616
- name: "Generate site using antora site action"
1717
uses: kameshsampath/antora-site-action@master
1818
with:
19-
antora_playbook: staging.yaml
19+
antora_playbook: site.yaml
2020
- name: "List folder"
2121
run: |
2222
ls -ltr $GITHUB_WORKSPACE/

.github/workflows/staging.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Knative Tutorial Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
env:
8+
SITE_DIR: 'gh-pages'
9+
jobs:
10+
build_site:
11+
name: "Build site with Antora"
12+
runs-on: [ubuntu-latest]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: "Generate site using antora site action"
17+
uses: kameshsampath/antora-site-action@master
18+
with:
19+
antora_playbook: staging.yaml
20+
- name: "List folder"
21+
run: |
22+
ls -ltr $GITHUB_WORKSPACE/
23+
- name: "Upload generated site"
24+
uses: actions/upload-artifact@v1.0.0
25+
with:
26+
name: site
27+
path: "${{ github.workspace }}/${{ env.SITE_DIR }}"
28+
deploy_site:
29+
runs-on: [ubuntu-latest]
30+
needs: [build_site]
31+
name: "Deploy to Staging"
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
with:
36+
repository: 'https://github.com/redhat-developer-docs/knative-tutorial-staging'
37+
token: "${{ env.GITHUB_TOKEN }}"
38+
- name: Download generated site
39+
uses: actions/download-artifact@v1
40+
with:
41+
name: site
42+
path: "${{ github.workspace }}/${{ env.SITE_DIR }}"
43+
- name: Deploy to GitHub Pages
44+
uses: JamesIves/github-pages-deploy-action@3.2.1
45+
with:
46+
GITHUB_TOKEN: " ${{ secrets.KNATIVE_TUTORIAL_STAGING}}"
47+
FOLDER: "${{ env.SITE_DIR }}"
48+
BRANCH: 'gh-pages'
49+
COMMIT_MESSAGE: "[Staging] Publish Documentation for ${{ github.sha }}"

0 commit comments

Comments
 (0)