Skip to content

Adjust and add new worflow to the new deployment way #272

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

Merged
merged 10 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/manually-trigger-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Manually trigger deploy to staging or production
run-name: "Manually deploy ${{ github.ref_name }} triggered by ${{ github.actor }}; version: ${{ inputs.version }}"

on:
workflow_dispatch:
inputs:
version:
description: "Enter the version number"
required: true
default: "main"
environment:
required: false
description: "Select the environment to deploy to"
type: choice
options:
- staging
# TODO: uncomment this when we want to deploy to production
# - production
default: staging

permissions:
id-token: write
contents: read

jobs:
trigger-staging-deploy:
runs-on: ubuntu-latest
if: ${{ inputs.version != '' && inputs.environment == 'staging' }}
environment: production-fidl
steps:
- name: Trigger staging deploy
uses: neti-filplus-infra/filplus-deploy-action@main
with:
version: ${{ inputs.version }}
environment: ${{ inputs.environment }}
ecr-repository: filplus-backend
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }}
aws-region: us-east-1

trigger-production-deploy:
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' && inputs.version != '' && inputs.environment == 'production' }}
environment: production-fidl
steps:
- name: Trigger production deploy
uses: neti-filplus-infra/filplus-deploy-action@main
with:
version: ${{ inputs.version }}
environment: ${{ inputs.environment }}
ecr-repository: filplus-registry
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }}
aws-region: us-east-1
24 changes: 23 additions & 1 deletion .github/workflows/publish-new-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
description: "Enter the version number"
required: true
default: "latest"
deploy-to-staging:
description: "Deploy the new version on staging?"
required: false
type: boolean
default: false

jobs:
code-check:
Expand Down Expand Up @@ -80,9 +85,26 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.bump-version.outputs.commit_sha }}

- name: Create and push tag
run: |
TAG_NAME="v${{ inputs.version }}"
git tag $TAG_NAME
git push origin $TAG_NAME

trigger-staging-deploy:
runs-on: ubuntu-latest
needs:
- code-check
- build-and-publish
if: ${{ inputs.version != '' && inputs.deploy-to-staging == true }}
environment: production-fidl
steps:
- name: Trigger staging deploy
uses: neti-filplus-infra/filplus-deploy-action@main
with:
version: ${{ inputs.version }}
environment: staging
ecr-repository: filplus-backend
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_IMAGE_DEPLOYER }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_IMAGE_DEPLOYER }}
aws-region: us-east-1