-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (80 loc) · 2.75 KB
/
CD_dev-release.yml
File metadata and controls
107 lines (80 loc) · 2.75 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CD | Dev Release
# Performs the task of merging from master to the dev-release branch.
# Pings the server to pull an update once the dev-release branch has been merged.
on:
push:
branches: [master]
workflow_dispatch:
jobs:
merge:
name: master -> master-ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Wait on check
uses: fountainhead/action-wait-for-check@v1.1.0
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: build
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Create Pull Request
if: steps.wait-for-build.outputs.conclusion == 'success'
uses: repo-sync/pull-request@v2
with:
destination_branch: "master-ci"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge master -> master-ci
if: steps.wait-for-build.outputs.conclusion == 'success'
uses: devmasx/merge-branch@1.4.0
with:
type: now
target_branch: master-ci
github_token: ${{ secrets.GITHUB_TOKEN }}
# master-ci -> dev-release
sanitize:
name: master-ci -> dev-release
runs-on: ubuntu-latest
steps:
- name: Checkout master-ci
uses: actions/checkout@v3
with:
ref: master-ci
fetch-depth: 0
- name: Wait on Merge
uses: fountainhead/action-wait-for-check@v1.1.0
id: wait-for-merge
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: master -> master-ci
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Checkout master-ci
uses: actions/checkout@v3
with:
ref: master-ci
fetch-depth: 0
- name: Remove Bloat
id: remove-bloat
if: steps.wait-for-merge.outputs.conclusion == 'success'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout dev-release
git reset --hard master-ci
git checkout master-ci
rm -rf LICENSE
rm -rf README.md
rm -rf docs
rm -rf tests
git add .
git commit -m "Merge master-ci into dev-release and remove unnecessary files"
git checkout dev-release
git merge master-ci --no-edit
git add .
git diff-index --quiet HEAD || git commit -m "Merge master-ci into dev-release and remove unnecessary files"
git push origin dev-release --force
- name: Webhook
uses: distributhor/workflow-webhook@v3
env:
webhook_url: "https://dev.recursion.space/webhooks/github/"
webhook_secret: "Y0uR5ecr3t"