Created
July 6, 2020 20:41
-
-
Save pmallol/529fe67cb9d18830503d5709b2735201 to your computer and use it in GitHub Desktop.
Add workflow file to deploy Middleman with GitHub Actions to GitHub Pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./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