-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (81 loc) · 3.5 KB
/
update-environments.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
84
85
# Refer to docs/testing-env.md to learn more about deployments configuration.
name: Update staging and production environments
on:
push:
branches:
- main
- stage-live
workflow_dispatch:
jobs:
sync-main-to-stage-live:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Open/update a PR from `main` to `stage-live`
id: pr
uses: tretuna/sync-branches@ea58ab6e406fd3ad016a064b31270bbb41127f41 # 1.4.0
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: "main"
TO_BRANCH: "stage-live"
PULL_REQUEST_TITLE: "🪄 [QA] Update stage environments"
PULL_REQUEST_BODY: |
This is a pull request that upon merging will update stage environments with recent `main` changes.
The environments that will be updated:
* Stage live: https://stage-live--taho-development.netlify.app/
* Stage fork: https://stage-fork--taho-development.netlify.app/
Read more: [Deployment to Production Flow](https://github.com/tahowallet/dapp/blob/main/docs/testing-env.md)
REVIEWERS: '["michalinacienciala"]'
- uses: studroid/label-pr-or-issue-action@ff48a93f6e1a8d8a6befdae900f54da173b17215 # v1.0.1
with:
pr-or-issue-number: ${{ steps.pr.outputs.PULL_REQUEST_NUMBER }}
label: "⚙️ deployment"
sync-stage-live-to-stage-fork:
if: github.ref == 'refs/heads/stage-live'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Sync `stage-fork` with `stage-live`
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git checkout stage-fork
git merge origin/stage-live
git push origin stage-fork
sync-stage-live-to-release:
if: github.ref == 'refs/heads/stage-live'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Needed so that we could create PR with `THESIS_VALKYRIE_PAT`,
# otherwise it doesn't trigger `test-list.yml`.
persist-credentials: false
- name: Open/update a PR from `main` to `stage-live`
id: pr
uses: tretuna/sync-branches@ea58ab6e406fd3ad016a064b31270bbb41127f41 # 1.4.0
with:
# We couldn't use GITHUB_TOKEN here, because events triggered by this
# token are not triggering other workflows (and we want trigger the
# `test-list.yml` workflow after `sync-stage-live-to-release` creates
# a PR).
GITHUB_TOKEN: ${{secrets.THESIS_VALKYRIE_PAT}}
FROM_BRANCH: "stage-live"
TO_BRANCH: "release"
PULL_REQUEST_TITLE: "🚀 [QA] Update release environment"
PULL_REQUEST_BODY: |
This is a pull request that upon merging will update production environment with recent `stage-live` changes.
The environment that will be updated:
* Production: https://taho-development.netlify.app/ (aka https://app.taho.xyz/)
Read more: [Deployment to Production Flow](https://github.com/tahowallet/dapp/blob/main/docs/testing-env.md)
REVIEWERS: '["michalinacienciala"]'
- uses: studroid/label-pr-or-issue-action@ff48a93f6e1a8d8a6befdae900f54da173b17215 # v1.0.1
with:
pr-or-issue-number: ${{ steps.pr.outputs.PULL_REQUEST_NUMBER }}
label: "⚙️ deployment"