Skip to content

🚨 Production Deployment #78

🚨 Production Deployment

🚨 Production Deployment #78

name: 🚨 Production Deployment
on:
workflow_dispatch:
inputs:
deployment-type:
description: 'Deploy to production from which branch? (staging for release, main for hotfix)'
required: true
default: 'staging'
type: choice
options:
- 'main'
- 'staging'
jobs:
merge-release-content-to-production:
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 ${{ env.DEPLOYMENT_TYPE }} into production
run: |
git fetch --unshallow
git checkout production
git pull origin production
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production"
git push origin production
merge-release-content-to-production-us:
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 ${{ env.DEPLOYMENT_TYPE }} into production-us
run: |
git fetch --unshallow
git checkout production-us
git pull origin production-us
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production-us"
git push origin production-us
merge-release-content-to-production-uk:
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 ${{ env.DEPLOYMENT_TYPE }} into production-uk
run: |
git fetch --unshallow
git checkout production-uk
git pull origin production-uk
git merge --no-ff origin/${{ env.DEPLOYMENT_TYPE }} -m "merge ${{ env.DEPLOYMENT_TYPE }} in production-uk"
git push origin production-uk