forked from awslabs/kubeflow-manifests
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.3 KB
/
build_push_website_folder.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
name: hugo-build-push-folder
on:
# Trigger the workflow on git push to a branch where this workflow file exists
push:
paths:
- website/**
branches:
- main
- 'release-v**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.93.0'
extended: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Run a multi-line script
run: |
cd $GITHUB_WORKSPACE/website
npm install [email protected]
base_url="baseURL = \"https://$GITHUB_REPOSITORY_OWNER.github.io/kubeflow-manifests/$(git branch --show-current)\""
sed -i "1s#.*#$base_url#" config.toml
hugo
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/public
destination_dir: ${{ steps.extract_branch.outputs.branch }}
keep_files: true