Skip to content

Merge pull request #1524 from gocd/dependabot/bundler/console-1.23.1 #343

Merge pull request #1524 from gocd/dependabot/bundler/console-1.23.1

Merge pull request #1524 from gocd/dependabot/bundler/console-1.23.1 #343

# 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@v3
- 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@v3
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'
S3_BUCKET: "${{ secrets.PREVIEW_S3_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