Skip to content

Commit effe380

Browse files
committed
Switch ci to github action
1 parent 0af3b8d commit effe380

File tree

4 files changed

+54
-41
lines changed

4 files changed

+54
-41
lines changed

.github/workflows/build-test.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- jekyll
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: 3.0
18+
- name: Install dependencies
19+
run: bundle install
20+
- name: Test
21+
run: bundle exec rake test
22+
- name: Gen page
23+
run: bundle exec rake build

.github/workflows/deploy.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- jekyll
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: 3.0
18+
- name: Install dependencies
19+
run: bundle install
20+
- name: Test
21+
run: bundle exec rake test
22+
- name: Gen page
23+
run: bundle exec rake build
24+
- name: Deploy to GitHub Pages
25+
if: success()
26+
uses: crazy-max/ghaction-github-pages@v2
27+
with:
28+
target_branch: master
29+
build_dir: public
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

Rakefile

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,6 @@ task :preview do
2727
sh 'jekyll serve --watch'
2828
end
2929

30-
# task travis: ENV["TRAVIS_PULL_REQUEST"] == "false" ? [:test, :build, :validate_markup, :release] : [:test, :build, :validate_markup]
31-
task travis: ENV["TRAVIS_PULL_REQUEST"] == "false" ? [:test, :build, :release] : [:test, :build]
32-
33-
desc "Release the current commit to ruby-korea/ruby-korea.github.io@master"
34-
task :release do
35-
commit = `git rev-parse HEAD`.chomp
36-
system "mkdir -p vendor/ruby-korea.github.io"
37-
system "git clone https://github.com/ruby-korea/ruby-korea.github.io.git vendor/ruby-korea.github.io"
38-
39-
Dir.chdir "vendor/ruby-korea.github.io" do
40-
sh "git config user.name '#{ENV['GIT_NAME']}'"
41-
sh "git config user.email '#{ENV['GIT_EMAIL']}'"
42-
sh 'git config credential.helper "store --file=.git/credentials"'
43-
File.open('.git/credentials', 'w') do |f|
44-
f.write("https://#{ENV['GH_TOKEN']}:@github.com")
45-
end
46-
sh "git reset --hard HEAD"
47-
sh "git checkout master"
48-
sh "git pull origin master"
49-
50-
rm_rf FileList["*"]
51-
cp_r FileList["../../_site/*"], "./"
52-
sh "git add -A ."
53-
sh "git commit -m 'ruby-korea/ruby-korea.github.io@#{commit}'"
54-
sh "git push origin master"
55-
end
56-
end
57-
5830
desc 'validate _site markup with validate-website'
5931
task :validate_markup do
6032
Dir.chdir('_site') do

0 commit comments

Comments
 (0)