-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (54 loc) · 2.02 KB
/
branch-deploy.yml
File metadata and controls
66 lines (54 loc) · 2.02 KB
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
name: branch-deploy
on:
issue_comment:
types: [created]
permissions: write-all
jobs:
rubocop:
name: runner / rspec
runs-on: ubuntu-20.04
env:
GITHUB_ORG_TOKEN: ${{ secrets.ORG_TOKEN }}
steps:
- name: branch-deploy
id: branch-deploy
uses: github/branch-deploy@v5.2.2
# Check out the ref from the output of the IssueOps command
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3.0.2
with:
ref: ${{ steps.branch-deploy.outputs.ref }}
- name: Clone Entitlements
if: steps.cache-entitlements-app.outputs.cache-hit != 'true'
run: |
git clone https://$GITHUB_ACCESS_TOKEN@github.com/Ballista-lTD/entitlements-app.git entitlements-app
mv entitlements-app/* .
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}
- uses: ruby/setup-ruby@cd4241788aec4fdcd3325da7068efa9b62a017af
with:
ruby-version: 2.7.5
bundler-cache: true
- name: Cache Ruby gems
id: cache-ruby-gems
uses: actions/cache@v2
with:
path: |
vendor/gems
bin
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('lib/**') }}
restore-keys: |
${{ runner.os }}-gems-
- name: bootstrap
if: steps.cache-ruby-gems.outputs.cache-hit != 'true'
run: script/bootstrap
# Here we run a deploy. It is "gated" by the IssueOps logic and will only run if the outputs from our branch-deploy step indicate that the workflow should continue
- name: deploy
if: ${{ steps.branch-deploy.outputs.continue == 'true' && steps.branch-deploy.outputs.noop != 'true' }}
run: |
set -o pipefail
script/deploy | tee deploy.out
MSG=$(cat deploy.out)
MSG="\`\`\`output\n${MSG}\n\`\`\`"
echo 'DEPLOY_MESSAGE<<EOF' >> $GITHUB_ENV
echo "$MSG" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV