Skip to content

Commit

Permalink
Merge pull request #15 from chessbyte/github_actions_4
Browse files Browse the repository at this point in the history
Fixed bundle install and refactored commit message
  • Loading branch information
Fryguy authored Feb 9, 2022
2 parents 9b4972f + 1be6393 commit 98d42e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
JEKYLL_ENV: production
MIQ_ENV: production
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PAYLOAD_REF: ${{ github.event.client_payload.ref }}
PAYLOAD_REF_NAME: ${{ github.event.client_payload.ref_name }}
PAYLOAD_SHA: ${{ github.event.client_payload.sha }}
PAYLOAD_REPOSITORY: ${{ github.event.client_payload.repository }}
PAYLOAD_PR_NUMBER: ${{ github.event.client_payload.pr_number }}
Expand All @@ -23,8 +23,9 @@ jobs:
- 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: create_commit_message.rb >> $GITHUB_ENV
run: |
cd manageiq.org
bundle install
exe/miq build all
- name: Deploy
run: deploy.sh
10 changes: 0 additions & 10 deletions create_commit_message.rb

This file was deleted.

16 changes: 15 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,19 @@ git config --global user.email "noreply@manageiq.org"
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 "${COMMIT_MESSAGE}"

commit_message=$(
ruby << RUBY
message =
if ENV["PAYLOAD_PR_NUMBER"].to_s =~ /^(\d+)$/
"#{ENV["PAYLOAD_REPOSITORY"]}##{\$1}"
else
"#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF_NAME"]})"
end
puts message
RUBY
)

git commit -m "Deploy for ${commit_message}"
git push origin master

0 comments on commit 98d42e7

Please sign in to comment.