A GitHub Action for deploying static sites. Works with any static site generator. Simple, fast, and easy.
This action uses the more secure github.token
rather than a user created Personal Access Token.
This action will only deploy a static site. However, see the below examples for building and deploying a static site.
build-dir
: The directory containing the files to deploy. Defaults tobuild
.deploy-branch
: The branch to deploy to your site to. Defaults togh-pages
.github-token
: The token to authorize push requests.github-actor
: Name of the deploy actor.github-repo
: GitHub repository to push the built site to.
Add/Customize one of the following examples to: .github/workflows/github-pages.yml
name: Build and Deploy a Jekyll Site
on:
push:
branches: [ main ]
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2 # Not needed with a .ruby-version file
bundler-cache: true
- run: bundle exec jekyll build
- name: Deploy site
with:
build-dir: _site
uses: NickSchimek/deploy_jamstack_action@main
name: Build and Deploy Middleman Site
on:
push:
branches: [ main ]
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2 # Not needed with a .ruby-version file
bundler-cache: true
- run: bundle exec middleman build
- name: Deploy site
uses: NickSchimek/deploy_jamstack_action@main