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

Alternative deploy to github pages instead of Rakefile #93

Open
gareth-cheeseman opened this issue Feb 26, 2023 · 0 comments
Open

Alternative deploy to github pages instead of Rakefile #93

gareth-cheeseman opened this issue Feb 26, 2023 · 0 comments

Comments

@gareth-cheeseman
Copy link

gareth-cheeseman commented Feb 26, 2023

Not an issue, but putting this here, in case it helps someone else. (thanks for the great theme btw)
I didn't want to use the UploadToGithub.Rakefile.

Github pages can now be deployed to with github actions publishing with github actions.

I develop in vscode using a devcontainer docker image, so I used this workflow that is very similar to the github actions default one. The differences are running it in the same container image I develop in and having the plan build step. (the github default one uses their executable that only allows their allowed list of plugins).

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
  # Runs on pushes targeting the default branch
  push:
    branches: ["master"]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow one concurrent deployment
concurrency:
  group: "pages"
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    container: mcr.microsoft.com/devcontainers/jekyll:0-bullseye
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup Pages
        uses: actions/configure-pages@v3
      - name: Build with Jekyll
        run: |
          bundle install
          jekyll build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v1

  # Deployment job
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

This allows me to develop normally with a gitignore that includes the _site folder. And deploys on any push to master.

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

No branches or pull requests

1 participant