Skip to content
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

Init feature branch #381

Closed
wants to merge 8 commits into from
Closed
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
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/deploy_to_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy to env

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
on:
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
type: environment
required: true
version:
description: Version to upload and deploy
type: string
workflow_call:
inputs:
env:
description: Environment to deploy to
type: string
required: true
region:
description: region to deploy to
type: string
required: true
account:
description: account to deploy to
type: string
required: true
version:
description: Version to upload and deploy
type: string
required: true
env:
VERSION: ${{inputs.version || github.sha}}
env: ${{ vars.ENV || inputs.env }}
region: ${{ vars.REGION || inputs.region }}
account: ${{ vars.ACCOUNT || inputs.account }}
jobs:
set-vars:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: print env vars
id: export-env-vars
run: |
echo "$account"
echo "$region"
echo "$env"

echo "region=$region" >> "$GITHUB_OUTPUT"
echo "account=$account" >> "$GITHUB_OUTPUT"
echo "env=$env" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
outputs:
region: ${{ steps.export-env-vars.outputs.region }}
account: ${{ steps.export-env-vars.outputs.account }}
env: ${{ steps.export-env-vars.outputs.env }}
version: ${{ steps.export-env-vars.outputs.version }}
upload:
needs: set-vars
name: Build and push image
uses: fetch-rewards/common-workflows/.github/workflows/publish-ecr.yml@main
with:
service-name: ${{ vars.SERVICE_NAME }}
version-tag: ${{ needs.set-vars.outputs.version }}
fsd-diff:
needs: [upload, set-vars]
name: Diff to ${{ inputs.environment }}
uses: fetch-rewards/common-workflows/.github/workflows/run-fsd.yml@main
with:
cmd_args: service eks diff --env ${{ needs.set-vars.outputs.env }} --region ${{ needs.set-vars.outputs.region }} --account ${{ needs.set-vars.outputs.account }} --version ${{ needs.set-vars.outputs.version }} --skip-ephemeris ${{ vars.SERVICE_NAME }}.yml
fsd-deploy:
needs: [upload, set-vars, fsd-diff]
name: Deploy to ${{ inputs.environment }}
uses: fetch-rewards/common-workflows/.github/workflows/run-fsd.yml@main
with:
cmd_args: service eks deploy --env ${{ needs.set-vars.outputs.env }} --region ${{ needs.set-vars.outputs.region }} --account ${{ needs.set-vars.outputs.account }} --version ${{ needs.set-vars.outputs.version }} --skip-ephemeris --source-legacy ${{ vars.SERVICE_NAME }}.yml
25 changes: 25 additions & 0 deletions .github/workflows/on_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: On main
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout

on:
workflow_dispatch:
push:
branches:
- main
jobs:
increment-version:
name: Increment release version tag
uses: fetch-rewards/common-workflows/.github/workflows/increment-semantic-version.yml@main
with:
version-type: patch
deploy-prod:
name: Deploy prod env
needs: [increment-version]
uses: fetch-rewards/build-your-own-radar/.github/workflows/deploy_to_env.yml@main
with:
env: prod
account: prod-services
region: us-east-1
version: ${{ needs.increment-version.outputs.new-tag }}
28 changes: 28 additions & 0 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: On pr
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout
actions: write
discussions: write
pull-requests: write
packages: write

on:
pull_request:
types: [opened, reopened, edited]
jobs:
fsd-diff:
name: Fsd diff
uses: fetch-rewards/common-workflows/.github/workflows/fsd-diff.yml@main
with:
config: ${{ vars.SERVICE_NAME }}.yml
region: us-east-1
env: dev
deploy-prod:
name: Deploy stage env
needs: [fsd-diff]
uses: fetch-rewards/build-your-own-radar/.github/workflows/deploy_to_env.yml@main
with:
env: stage
account: stage-services
region: us-east-1
Loading