Merge pull request #1780 from gocd/dependabot/bundler/sass-embedded-1… #651
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.3 | |
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 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
bundler-cache: false # true would run bundle install | |
- name: Set up user in git config | |
env: | |
USER: "${{ secrets.GH_PREVIEW_WRITE_USER }}" | |
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.GH_PREVIEW_WRITE_USER }}" | |
TOKEN: "${{ secrets.GH_PREVIEW_WRITE_USER_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 |