Skip to content

Merge pull request #211 from oshwa/migrate-gh-actions #1

Merge pull request #211 from oshwa/migrate-gh-actions

Merge pull request #211 from oshwa/migrate-gh-actions #1

Workflow file for this run

name: build
run-name: Jekyll Contentful Build and Deploy
on:
workflow_call:
secrets:
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:
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-latest
strategy:
matrix:
ruby-version: [3.1.0]
node-version: [16.14]
steps:
- uses: actions/checkout@v4
- 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