Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cappert/3619710dbfc8b589d9f13589944fa141 to your computer and use it in GitHub Desktop.
Save cappert/3619710dbfc8b589d9f13589944fa141 to your computer and use it in GitHub Desktop.
Add workflow file to deploy Middleman with GitHub Actions to GitHub Pages
# ./github/workflows/deploy.yml
name: Deploy Middleman to GH Pages
on:
push:
branches: [master]
jobs:
build:
name: Build website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Ruby gem cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install Gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 13.x
- name: Node packages cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install packages
run: npm install
- name: Build Middleman
run: bundle exec middleman build
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment