Skip to content

Commit

Permalink
Add GitHub workflow for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik committed Nov 3, 2023
1 parent bd3f98e commit 16a930f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and deploy

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2

- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Compile
run: |
bundle exec rake compile:all
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
source "https://rubygems.org"

# NOTE: Keep in sync with .github/workflows/main.yml.
ruby "3.2.2"

gem "rake"
gem "webrick"
gem "slim"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ TODO: Run guard automatically via Devbox.

## Production

Deployed via [GitHub Pages](https://pages.github.com/). Just push.
Just push.

Deployed via [GitHub Pages](https://pages.github.com/) and the workflow in `.github/workflows/main.yml`.
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ namespace :compile do
puts "Compiled #{file} to CSS!"
end
end

desc "Compile Slim and Sass"
task :all => [ :slim, :sass ]
end

0 comments on commit 16a930f

Please sign in to comment.