π Sandbox Deployment #64
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: π Sandbox Deployment | |
on: | |
workflow_dispatch: | |
inputs: | |
deployment-type: | |
description: 'Deploy to sandbox from which branch? (staging for release, main for hotfix)' | |
required: true | |
default: 'staging' | |
type: choice | |
options: | |
- 'main' | |
- 'staging' | |
jobs: | |
merge-staging-to-sandbox: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Git config | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Set deployment type | |
run: | | |
echo "DEPLOYMENT_TYPE=${{ github.event.inputs.deployment-type }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Merge staging into sandbox | |
run: | | |
git fetch --unshallow | |
git switch sandbox | |
git pull origin sandbox | |
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "Merge ${{ env.DEPLOYMENT_TYPE }} into sandbox" | |
git push origin sandbox |