-
Notifications
You must be signed in to change notification settings - Fork 17
38 lines (36 loc) · 1.26 KB
/
build.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
name: Deploy site
on: { push: { branches: [master] } }
jobs:
build:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install gems
run: gem install redcarpet rouge
- name: Set environment variables
run: echo "SITE_ROOT=deploy" >> $GITHUB_ENV
- name: Build (for forks)
if: ${{ github.repository_owner != 'lite-xl' }}
run: ruby site.rb "/$(echo '${{ github.repository }}' | cut -d/ -f2)"
- name: Build (for lite-xl org)
if: ${{ github.repository_owner == 'lite-xl' }}
run: ruby site.rb
- name: Upload to GitHub pages (for lite-xl org)
if: ${{ github.repository_owner == 'lite-xl' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy
cname: lite-xl.com
- name: Upload to GitHub pages (for forks)
if: ${{ github.repository_owner != 'lite-xl' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy