cisagov / manage.get.gov

A Django-based domain name registrar used by the .gov domain to communicate with an EPP registry
https://get.gov
Other
54 stars 15 forks source link

Github workflow to deploy to another sandbox #2398

Open abroddrick opened 1 week ago

abroddrick commented 1 week ago

Issue description

In engineering huddle, we discussed having a new workflow that would let us to select a branch and deploy that branch to a sandbox of our choosing. The goal would be to easily move code between sandbox and not have to worry about collecting static locally and doing a cf push from our local env. This would help engineers that have multiple PRs in flight or who hit migrations issues on one sandbox.

Acceptance criteria

Additional context

Important note: workflows don't get applied until merging, expect that you will have multiple merges to review your action. Do not use the resolves ticket # language in your PR as that will close your ticket upon merging, instead put wording like testing # and get the dev reviewer to look at your github workflow on github itself.

Because you need someone else to approve your PR this may work best pairing with someone, or branching the repo.

Really quick I assume the workflow needed would be:

name: Manual Build and Deploy

on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Environment to deploy'
        required: true
        default: 'ab'
        type: choice
        options:
          - ab
          - ...# all the other sandboxes
          - meoward
          - bob
          - cb
      branch:
        description: 'Branch to deploy'
        required: true
        default: 'main'
        type: string

jobs:
  variables:
    runs-on: ubuntu-latest
    steps:
      - name: Setting global variables
        uses: actions/github-script@v6
        id: var
        with:
          script: |
            core.setOutput('environment', '${{ github.event.inputs.environment }}');
            core.setOutput('branch', '${{ github.event.inputs.branch }}');

  deploy:

Links to other issues

No response

abroddrick commented 1 week ago

tentatively adding to sprint 50, as this is a really good one to help devs and should be fairly light lift