Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Deploy via GitHub Workflow #232

Open
alex-hedley opened this issue Jan 30, 2023 · 0 comments
Open

[Docs] Deploy via GitHub Workflow #232

alex-hedley opened this issue Jan 30, 2023 · 0 comments

Comments

@alex-hedley
Copy link

I've created a simple GitHub Pages Workflow to deploy this template.

Update the config.rb (See Middleman Github Pages - Project Page Path Issues)

activate :relative_assets
set :relative_links, true

Create a deploy.yml file in the .github/workflows/ folder.

name: Deploy

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - "source/**"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: write
  pages: write

jobs:
  build_and_deploy:
    name: Build & Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        
      - name: Set up 💎 Ruby 3.2.0
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.2.0
#           bundler-cache: true
        
      - name: Install Dependencies
        run: |
          echo 'Installing bundles...'
          gem install bundler
          bundle install
          bundle list | grep "middleman ("
        
      - name: Build
        run: bundle exec middleman build
      
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3.9.2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: build

Would it be worth adding this to the Documentation Site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant