forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.28 KB
/
deploy.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
name: deploy
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.2'
bundler-cache: true
- name: Install deps
run: |
npm install -g mermaid.cli
- name: Setup deploy options
id: setup
run: |
git config --global user.name "GitHub Action"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [[ ${GITHUB_REF} = refs/pull/*/merge ]]; then # pull request
echo "::set-output name=SRC_BRANCH::${GITHUB_HEAD_REF}"
echo "::set-output name=NO_PUSH::--no-push"
elif [[ ${GITHUB_REF} = refs/heads/* ]]; then # branch, e.g. master, source etc
echo "::set-output name=SRC_BRANCH::${GITHUB_REF#refs/heads/}"
fi
echo "::set-output name=DEPLOY_BRANCH::gh-pages"
- name: Deploy website
run: yes | bash bin/deploy --verbose ${{ steps.setup.outputs.NO_PUSH }}
--src ${{ steps.setup.outputs.SRC_BRANCH }}
--deploy ${{ steps.setup.outputs.DEPLOY_BRANCH }}