|
| 1 | +name: Manually trigger deploy to staging or production |
| 2 | +run-name: "Manually deploy ${{ github.ref_name }} triggered by ${{ github.actor }}; version: ${{ inputs.version }}" |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + version: |
| 8 | + description: "Enter the version number" |
| 9 | + required: true |
| 10 | + default: "main" |
| 11 | + environment: |
| 12 | + required: false |
| 13 | + description: "Select the environment to deploy to" |
| 14 | + type: choice |
| 15 | + options: |
| 16 | + - staging |
| 17 | + # TODO: uncomment this when we want to deploy to production |
| 18 | + # - production |
| 19 | + default: staging |
| 20 | + |
| 21 | +permissions: |
| 22 | + id-token: write |
| 23 | + contents: read |
| 24 | + |
| 25 | +jobs: |
| 26 | + trigger-staging-deploy: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + if: ${{ inputs.version != '' && inputs.environment == 'staging' }} |
| 29 | + environment: production-fidl |
| 30 | + steps: |
| 31 | + - name: Trigger staging deploy |
| 32 | + uses: neti-filplus-infra/filplus-deploy-action@main |
| 33 | + with: |
| 34 | + version: ${{ inputs.version }} |
| 35 | + environment: ${{ inputs.environment }} |
| 36 | + ecr-repository: filplus-backend |
| 37 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }} |
| 38 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }} |
| 39 | + aws-region: us-east-1 |
| 40 | + |
| 41 | + trigger-production-deploy: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + if: ${{ github.ref_name == 'main' && inputs.version != '' && inputs.environment == 'production' }} |
| 44 | + environment: production-fidl |
| 45 | + steps: |
| 46 | + - name: Trigger production deploy |
| 47 | + uses: neti-filplus-infra/filplus-deploy-action@main |
| 48 | + with: |
| 49 | + version: ${{ inputs.version }} |
| 50 | + environment: ${{ inputs.environment }} |
| 51 | + ecr-repository: filplus-registry |
| 52 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }} |
| 53 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }} |
| 54 | + aws-region: us-east-1 |
0 commit comments