Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to GitHub Actions #12

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build
on:
repository_dispatch:
types: [deploy]
jobs:
deploy:
runs-on: ubuntu-latest
env:
JEKYLL_ENV: production
MIQ_ENV: production
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAYLOAD_REF: ${{ github.event.client_payload.ref }}
PAYLOAD_SHA: ${{ github.event.client_payload.sha }}
PAYLOAD_REPOSITORY: ${{ github.event.client_payload.repository }}
PAYLOAD_COMMIT_MESSAGE: ${{ github.event.client_payload.commit_message }}
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.5'
bundler-cache: true
- name: Get manageiq.org repo
run: git clone https://github.com/ManageIQ/manageiq.org
- name: Build
run: cd manageiq.org & exe/miq build all
- name: Set COMMIT_MESSAGE
run: parse_commit_message.rb >> $GITHUB_ENV
- name: Deploy
run: deploy.sh
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

set -x

cd dest
cd manageiq.org/dest

echo "www.manageiq.org" > CNAME

git config --global user.name "ManageIQ Bot"
git config --global user.email "noreply@manageiq.org"

git clone --bare --branch master --depth 5 https://miq-bot:${GITHUB_TOKEN}@github.com/ManageIQ/manageiq.github.io .git
git clone --bare --branch master --depth 5 https://x-access-token:${GITHUB_TOKEN}@github.com/ManageIQ/manageiq.github.io .git
git config core.bare false
git add -A
git commit -m "${TRAVIS_COMMIT_MESSAGE}"
git commit -m "${COMMIT_MESSAGE}"
git push origin master
10 changes: 10 additions & 0 deletions parse_commit_message.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env ruby

message =
if ENV["PAYLOAD_COMMIT_MESSAGE"].to_s =~ /\AMerge pull request (#\d+)/
"#{ENV["PAYLOAD_REPOSITORY"]}#{\$1}"
else
"#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF"]})"
end

puts "COMMIT_MESSAGE=\"#{message}\""
39 changes: 0 additions & 39 deletions trigger.sh

This file was deleted.