Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: action to create daily qa branch implemented #1494

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/create-qa-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create Daily QA Environment
env:
QA_BRANCH_NAME: changeset/daily-qa-branch
DEFAULT_BRANCH: main
PSH_PROJECT_ID: ${{ secrets.PSH_PROJECT_ID }}
PLATFORMSH_CLI_TOKEN: ${{ secrets.PLATFORMSH_CLI_TOKEN }}
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
jobs:
process_branch:
name: Create daily QA branch and activate psh env
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Initialize Platform.sh
run: |
curl -sS https://platform.sh/cli/installer | php
- name: Delete Environment
continue-on-error: true
run: |
~/.platformsh/bin/platform environment:delete -p $PSH_PROJECT_ID -e $QA_BRANCH_NAME --yes
- name: Delete branch
continue-on-error: true
run: |
git push --delete origin $QA_BRANCH_NAME
- name: Create branch
run: |
git checkout -b $QA_BRANCH_NAME $DEFAULT_BRANCH
git push --set-upstream origin $QA_BRANCH_NAME
- name: Deploy Environment
run: |
sleep 10
~/.platformsh/bin/platform env:activate -p $PSH_PROJECT_ID -e $QA_BRANCH_NAME