-
Notifications
You must be signed in to change notification settings - Fork 108
64 lines (60 loc) · 2.07 KB
/
build_and_preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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