Skip to content

Commit 07392b2

Browse files
committed
Switch to GitHub Actions
1 parent d2946a3 commit 07392b2

File tree

5 files changed

+43
-70
lines changed

5 files changed

+43
-70
lines changed

.github/workflows/deploy.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
on:
3+
repository_dispatch:
4+
types: [deploy]
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
env:
9+
JEKYLL_ENV: production
10+
MIQ_ENV: production
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
PAYLOAD_REF: ${{ github.event.client_payload.ref }}
13+
PAYLOAD_SHA: ${{ github.event.client_payload.sha }}
14+
PAYLOAD_REPOSITORY: ${{ github.event.client_payload.repository }}
15+
PAYLOAD_COMMIT_MESSAGE: ${{ github.event.client_payload.commit_message }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: '2.5'
22+
bundler-cache: true
23+
- name: Get manageiq.org repo
24+
run: git clone https://github.com/ManageIQ/manageiq.org
25+
- name: Build
26+
run: cd manageiq.org & exe/miq build all
27+
- name: Set COMMIT_MESSAGE
28+
run: parse_commit_message.rb >> $GITHUB_ENV
29+
- name: Deploy
30+
run: deploy.sh

.travis.yml

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

deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
set -x
44

5-
cd dest
5+
cd manageiq.org/dest
66

77
echo "www.manageiq.org" > CNAME
88

99
git config --global user.name "ManageIQ Bot"
1010
git config --global user.email "[email protected]"
1111

12-
git clone --bare --branch master --depth 5 https://miq-bot:${GITHUB_TOKEN}@github.com/ManageIQ/manageiq.github.io .git
12+
git clone --bare --branch master --depth 5 https://x-access-token:${GITHUB_TOKEN}@github.com/ManageIQ/manageiq.github.io .git
1313
git config core.bare false
1414
git add -A
15-
git commit -m "${TRAVIS_COMMIT_MESSAGE}"
15+
git commit -m "${COMMIT_MESSAGE}"
1616
git push origin master

parse_commit_message.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env ruby
2+
3+
message =
4+
if ENV["PAYLOAD_COMMIT_MESSAGE"].to_s =~ /\AMerge pull request (#\d+)/
5+
"#{ENV["PAYLOAD_REPOSITORY"]}#{\$1}"
6+
else
7+
"#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF"]})"
8+
end
9+
10+
puts "COMMIT_MESSAGE=\"#{message}\""

trigger.sh

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

0 commit comments

Comments
 (0)