-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (77 loc) · 2.59 KB
/
release.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
on:
push:
branches: [develop]
jobs:
# Our sample repo has no tests but this is where you would include your unit
# tests to run concurrently with your Rainforest tests.
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Tests
run: bundle exec rake
env:
RACK_ENV: test
# This sample repo has functional GitHub Actions and CircleCI workflows. To avoid conflicts
# we only use one tool for each release.
pick_ci:
outputs:
chosen_ci: ${{ steps.pick_ci.outputs.chosen_ci }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: pick_ci
name: Pick CI
run: |
ci=$(script/pick_ci.sh)
echo "Picked $ci"
echo "chosen_ci=$ci" >> $GITHUB_OUTPUT
# Push our code to our staging or QA server. We're using Heroku here but you will need to
# change this to match how you deploy your releases.
deploy_staging:
runs-on: ubuntu-latest
needs: pick_ci
if: needs.pick_ci.outputs.chosen_ci == 'github-actions'
steps:
- uses: actions/checkout@v4
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: rainforest-ci-sample-staging
heroku_email: ${{ secrets.HEROKU_EMAIL }}
# Run our Rainforest tests. `run_group_id` should point to the Run Group you
# want to use for your releases. See the action documentation for additional
# options you can use: https://github.com/marketplace/actions/rainforest-qa-github-action
run_rainforest:
runs-on: ubuntu-latest
needs: deploy_staging
steps:
- uses: rainforestapp/github-action@v3
with:
token: ${{ secrets.RF_MAIN_API_TOKEN }}
run_group_id: 7597
# Our Rainforest build was successful! Push the code to the master branch.
merge_to_master:
runs-on: ubuntu-latest
needs: [test, run_rainforest]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git push origin $GITHUB_SHA:refs/heads/master
# Now that the master branch has been updated, deploy to production.
deploy_production:
runs-on: ubuntu-latest
needs: merge_to_master
steps:
- uses: actions/checkout@v4
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: rainforest-ci-sample-prd
heroku_email: ${{ secrets.HEROKU_EMAIL }}