Merge pull request #171 from RecursionSpace/dependabot/github_actions… #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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/[email protected] | |
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/[email protected] | |
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 [email protected] | |
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" |