Skip to content

Merge pull request #1556 from gocd/dependabot/bundler/public_suffix-5… #390

Merge pull request #1556 from gocd/dependabot/bundler/public_suffix-5…

Merge pull request #1556 from gocd/dependabot/bundler/public_suffix-5… #390

# This workflow will build a middleman project with bundle
name: Build and Preview
on:
push:
branches:
- master
env:
RUBYOPT: -W0 # needed to not print the warnings - makes the logs too big
BUNDLE_BUILD__SASSC: --disable-march-tune-native
RUN_EXTERNAL_CHECKS: true
jobs:
complete_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: false # true would run bundle install
- name: Run the build
run: |
bundle config --local build.sassc --disable-march-tune-native
bundle install
bundle exec rake build --verbose
push_to_gh_pages:
needs: complete_build
runs-on: ubuntu-latest
env:
GITHUB_PASSWORD: "${{ secrets.GITHUB_TOKEN }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: false # true would run bundle install
- name: Set up user in git config
env:
USER: "${{ secrets.USER_TO_WRITE }}"
run: |
git config --global user.name "${USER}"
git config --global user.email "${USER}@github.com"
- name: Set up upstream and publish to gh pages
run: |
bundle config --local build.sassc --disable-march-tune-native
bundle install
git remote add preview https://${USER}:${TOKEN}@github.com/gocd/preview.go.cd.git
bundle exec rake publish --trace
env:
USER: "${{ secrets.USER_TO_WRITE }}"
TOKEN: "${{ secrets.USER_TO_WRITE_ACCESS_TOKEN }}"
REMOTE_NAME: "preview"
ALLOW_DIRTY: true
BASE_URL: 'https://preview.gocd.org'
DEPLOY_ENVIRONMENT: 'preview'
AWS_BUCKET: "${{ secrets.PREVIEW_AWS_BUCKET }}"
AWS_ACCESS_KEY_ID: "${{ secrets.PREVIEW_AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.PREVIEW_AWS_SECRET_ACCESS_KEY }}"
RUN_EXTERNAL_CHECKS: false