-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.4 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
39
40
41
42
43
44
45
46
47
48
name: Build and Deploy to Github Pages
on:
push:
branches:
- master # Here source code branch is `master`, it could be other branch
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Use GitHub Actions' cache to cache dependencies on servers
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Create timestamp.json file
- name: Create timestamp file
run: echo "{\"timestamp\":\"$(date +%s)\"}" > timestamp.json
# Use GitHub Deploy Action to build and deploy to Github
- uses: jeffreytse/jekyll-deploy-action@v0.3.1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.0' # Specify Ruby version
- name: Install Bundler
run: gem install bundler -v 2.2.30 # Install the required Bundler version
- name: Bundle Install
run: bundle install # Run bundle install
with:
provider: 'github'
token: ${{ secrets.GITHUB_TOKEN }}
cname: ${{ secrets.CNAME }}
# Add timestamp.json to build artifact
- name: Add timestamp to build artifact
uses: actions/upload-artifact@v2
with:
name: timestamp
path: timestamp.json