Skip to content

Commit

Permalink
using two targets for middleman config
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncastro1990 committed Apr 12, 2024
1 parent 2ef29f1 commit e3296a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
gem update --system 3.2.3
echo "Pull Request: $TRAVIS_PULL_REQUEST"
# Ensure the site builds, otherwise fail the build on PRs
if [[ $CI_NODE_INDEX = "build" && $TRAVIS_PULL_REQUEST != 'false' ]]; then bundle exec rake download_policy_list; bundle exec middleman build; fi
if [[ $CI_NODE_INDEX = "build" && $TRAVIS_PULL_REQUEST != 'false' ]]; then bundle exec rake download_policy_list; TARGET="test" bundle exec middleman deploy; fi
# Ensure the links work, otherwise fail the build on PRs (only on PRs)
if [[ $CI_NODE_INDEX = "check_links" && $TRAVIS_PULL_REQUEST != 'false' ]]; then echo "TODO Fix check_links to throttle itself properly"; fi
# Only deploy the site live if the master branch is updated (not during pull-requests)
Expand Down
24 changes: 18 additions & 6 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,27 @@ def image(link, title, alt_text)
end

# middleman-deploy configuration
activate :deploy do |deploy|
# Automatically run `middleman build` during `middleman deploy`
deploy.build_before = true

# rsync, ftp, sftp, or git
deploy.method = :git
case ENV['TARGET'].to_s.downcase
when 'test'
activate :deploy do |deploy|
# Automatically run `middleman build` during `middleman deploy`
deploy.build_before = true

# rsync, ftp, sftp, or git
deploy.method = :git
deploy.branch = "test-gh-pages"
end
else
activate :deploy do |deploy|
# Automatically run `middleman build` during `middleman deploy`
deploy.build_before = true

# rsync, ftp, sftp, or git
deploy.method = :git
end
end


page "/release-feed.xml", :layout => false

# Activate middleman-breadcrumb gem
Expand Down

0 comments on commit e3296a0

Please sign in to comment.