-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.74 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
49
50
51
52
53
54
name: build
run-name: Jekyll Contentful Build and Deploy
on:
workflow_call:
secrets:
ACTIONS_DEPLOY_KEY:
description: GitHub Deploy Key
OSHWA_CONTENTFUL_SPACE_ID:
description: 'Contentful Space ID passed from the build-on-publish.yml workflow'
required: true
OSHWA_CONTENTFUL_DELIVERY_TOKEN:
description: 'Contentful Access Token passed from the build-on-publish.yml workflow'
required: true
push:
branches: [ main ]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
OSHWA_CONTENTFUL_SPACE_ID: ${{ secrets.OSHWA_CONTENTFUL_SPACE_ID }}
OSHWA_CONTENTFUL_DELIVERY_TOKEN: ${{ secrets.OSHWA_CONTENTFUL_DELIVERY_TOKEN }}
jobs:
pull-build-deploy:
runs-on: ubuntu-22.04
strategy:
matrix:
ruby-version: [3.1.2]
node-version: [16.14]
steps:
- uses: actions/checkout@v4
- name: Update Main Branch
run: git pull origin main
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install bundler
run: gem install bundler
- name: Install dependencies
run: bundle install
- name: Pull data from Contentful
run: bundle exec jekyll contentful
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install npm dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./_site