forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (49 loc) · 2.07 KB
/
deploy.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
name: Deploy code to staging or production
on:
push:
branches: [production]
jobs:
validate:
runs-on: ubuntu-latest
outputs:
isAutomergePR: ${{ steps.isAutomergePR.outputs.IS_AUTOMERGE_PR }}
steps:
- name: Get merged pull request
id: getMergedPullRequest
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if merged pull request was an automatic version bump PR
id: isAutomergePR
run: echo "::set-output name=IS_AUTOMERGE_PR::${{ contains(steps.getMergedPullRequest.outputs.labels, 'automerge') && github.actor == 'OSBotify' }}"
deployProduction:
runs-on: ubuntu-latest
needs: validate
if: ${{ needs.validate.outputs.isAutomergePR == 'true' && github.ref == 'refs/heads/production' }}
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
fetch-depth: 0
token: ${{ secrets.OS_BOTIFY_TOKEN }}
- name: Checkout production branch
run: git checkout production
- name: Get current app version
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> $GITHUB_ENV
- name: Get Release Pull Request List
id: getReleasePRList
uses: Expensify/Expensify.cash/.github/actions/getReleasePullRequestList@master
with:
TAG: ${{ env.PRODUCTION_VERSION }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
- name: Generate Release Body
id: getReleaseBody
uses: Expensify/Expensify.cash/.github/actions/getReleaseBody@master
with:
PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }}
- name: 🚀 Create release to trigger production deploy 🚀
uses: softprops/action-gh-release@affa18ef97bc9db20076945705aba8c516139abd
with:
tag_name: ${{ env.PRODUCTION_VERSION }}
body: ${{ steps.getReleaseBody.outputs.RELEASE_BODY }}
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}