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

Merge Main #41

Merged
merged 232 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
83ab632
feat: backend initial structure
alessandrak Apr 3, 2023
5dcde1a
fix: update modules
alessandrak Apr 3, 2023
4641604
FEAT: Create the Auth Route
wjuniorbh92 Apr 5, 2023
09e3d1c
feat: add database migrations
alessandrak Apr 6, 2023
207dc5b
fix: migrate init function name
alessandrak Apr 6, 2023
445fa88
Merge pull request #2 from CheesecakeLabs/T1A-75_feat_setup-db-tables
alessandrak Apr 10, 2023
2174838
Refactor: Create a Function handle the auth routes
wjuniorbh92 Apr 10, 2023
466ec3a
Merge branch 'dev' of https://github.com/CheesecakeLabs/token-factory…
wjuniorbh92 Apr 10, 2023
659be13
Improviment : Create a auth_test
wjuniorbh92 Apr 12, 2023
9e3773e
Refactor: Change the auth for another use case
wjuniorbh92 Apr 13, 2023
3387c9d
Refactor: Create the Logout Route and the new Migration
wjuniorbh92 Apr 13, 2023
8d4bfb1
TEST: Add users_test
wjuniorbh92 Apr 18, 2023
db43cd8
TEST: Add more use cases
wjuniorbh92 Apr 18, 2023
65119f8
feat: add create wallet api (wip)
alessandrak Apr 19, 2023
1736f3e
feat: add kafka communication on http apis
alessandrak Apr 20, 2023
0fca955
tests: wallets usecase and repo mock
alessandrak Apr 21, 2023
cd48612
tests: fix controller utils tests
alessandrak Apr 21, 2023
cda1c79
docs: setup swagger to wallets apis
alessandrak Apr 21, 2023
3cc757a
tests: fix kafka connection test
alessandrak Apr 21, 2023
7d26bbc
Merge pull request #1 from CheesecakeLabs/T1A-12---Create-the-authent…
wjuniorbh92 Apr 25, 2023
fbbdb16
feat: add fund wallet api
alessandrak Apr 26, 2023
221aaa1
tests: fix mocks
alessandrak Apr 26, 2023
81446dd
docs: add fund wallet docs
alessandrak Apr 26, 2023
dbe94f8
Merge branch 'dev' of https://github.com/CheesecakeLabs/token-factory…
alessandrak Apr 26, 2023
7109069
fix: merge fix
alessandrak Apr 26, 2023
ec8da75
Merge branch 'T1A-76_feat_create-sponsor-wallet' of https://github.co…
alessandrak Apr 26, 2023
a95ddc3
feat: add funded field on wallet table
alessandrak Apr 26, 2023
704d9bf
tests: add get and update wallet use case tests
alessandrak Apr 26, 2023
117e20c
Init: Create the docker files in a bash script
wjuniorbh92 Apr 26, 2023
a184b50
Update Dockerfile
wjuniorbh92 Apr 27, 2023
618f92c
Update docker-compose.yml
wjuniorbh92 Apr 27, 2023
3ef6639
Update docker-compose.yml
wjuniorbh92 Apr 27, 2023
9bf8c61
feat: add create asset route
alessandrak Apr 27, 2023
9491024
feat: add issue asset api
alessandrak Apr 28, 2023
e0c8ebe
tests: add assets usecase tests
alessandrak May 1, 2023
72824c3
Change the dockerfile
wjuniorbh92 May 1, 2023
d7c30ac
Merge branch 'T1A-102--Create-docker-file' of https://github.com/Chee…
wjuniorbh92 May 1, 2023
30d66ec
Create a Dev docker file
wjuniorbh92 May 1, 2023
7cd05fe
Create the integration file
wjuniorbh92 May 1, 2023
e567b96
Refactor: Add one docker-compose to start the test
wjuniorbh92 May 1, 2023
537cacd
Refactor: Add KMS docker-compose
wjuniorbh92 May 1, 2023
886a398
fix: add const operation types
alessandrak May 2, 2023
6f802a7
REFACTOR: Add the starlabs test
wjuniorbh92 May 2, 2023
99557e5
Merge pull request #5 from CheesecakeLabs/T1A-102--Create-docker-file
wjuniorbh92 May 2, 2023
189953b
Merge branch 'dev'
alessandrak May 16, 2023
8f6258f
Merge pull request #3 from CheesecakeLabs/T1A-76_feat_create-sponsor-…
alessandrak May 16, 2023
a3b460c
Merge branch 'dev' of https://github.com/CheesecakeLabs/token-factory…
alessandrak May 16, 2023
05db7a9
Merge pull request #4 from CheesecakeLabs/T1A-78_feat_fund-with-frien…
alessandrak May 16, 2023
a359ee1
Merge branch 'dev' of https://github.com/CheesecakeLabs/token-factory…
alessandrak May 16, 2023
6613941
Merge pull request #6 from CheesecakeLabs/T1A-97_feat_asset-issuance
alessandrak May 16, 2023
286808d
Role permisions migrations added
May 22, 2023
9d6db23
/v1/role endpoint added
May 22, 2023
e71e879
FEAT: Create a mint
wjuniorbh92 May 25, 2023
34c0bb2
Feat: Create a Mint File
wjuniorbh92 May 25, 2023
5c092ce
FEAT: Create a Mint Route
wjuniorbh92 May 25, 2023
e581832
Role permission feature added
May 26, 2023
de73a3f
Merge pull request #7 from CheesecakeLabs/role-permissions-list
mvnthomaz May 26, 2023
162043b
REFACTOR: Change the Kms Issuer
wjuniorbh92 May 29, 2023
f7d8ef2
REFACTOR: Create the swag files
wjuniorbh92 May 30, 2023
0060fe2
Removed unused struct
May 31, 2023
97bc361
feat: initial commit
lucasmagnus Jun 1, 2023
94022d8
FEAT: Create a Burn route
wjuniorbh92 Jun 2, 2023
6241077
Update backend/internal/usecase/repo/user_postgres.go
mvnthomaz Jun 2, 2023
aad05ab
Validate function changed
Jun 2, 2023
09b366f
Merge branch 'T1A-107--Create-a-route-to-Burn-Asset' into T1A-108--Pa…
wjuniorbh92 Jun 4, 2023
84bc139
FEAT: Create a transfer route
wjuniorbh92 Jun 4, 2023
65d56d1
feat: assets management component
lucasmagnus Jun 5, 2023
c5ddd31
feat: last transactions component
lucasmagnus Jun 5, 2023
9f56ee3
feat: sign up
lucasmagnus Jun 6, 2023
de650b0
handling database errors added
Jun 6, 2023
6531c9e
role permission middleware moved
Jun 6, 2023
7e12b0d
feat: new login
lucasmagnus Jun 6, 2023
3837626
feat: update home
lucasmagnus Jun 6, 2023
2595d51
feat: integrate sign in
lucasmagnus Jun 12, 2023
4840728
feat: update home
lucasmagnus Jun 12, 2023
58105d6
feat: logout
lucasmagnus Jun 12, 2023
4511fbf
feat: switch color
lucasmagnus Jun 12, 2023
459894e
feat: dark mode
lucasmagnus Jun 13, 2023
4d55060
feat: settings components
lucasmagnus Jun 13, 2023
ece63e2
Merge pull request #12 from CheesecakeLabs/feat_starter_frontend
lucasmagnus Jun 13, 2023
df2b419
Merge branch 'dev' into T1A-106--Create-mint-route
wjuniorbh92 Jun 14, 2023
747ac97
FEAT: Create a Clawback transaction
wjuniorbh92 Jun 14, 2023
e18d735
feat: list members
lucasmagnus Jun 14, 2023
7888116
feat: permissions
lucasmagnus Jun 15, 2023
3a1892b
fix: dark theme
lucasmagnus Jun 16, 2023
968083a
usecase role permission tests added
Jun 16, 2023
5667d44
remove commented code
Jun 16, 2023
ec717d7
feat: add email and permissions settings
lucasmagnus Jun 16, 2023
4b9bec2
Update Public Keys
wjuniorbh92 Jun 16, 2023
c46017e
Refactor: Remove the ClawbackID
wjuniorbh92 Jun 16, 2023
6941bc8
Merge branch 'T1A-111--Create-a-ClawbackFlag-in-the-TokenFactory' of …
wjuniorbh92 Jun 16, 2023
6d49723
Remove Asset Code
wjuniorbh92 Jun 16, 2023
48d8cd4
FIX: Fix Swag
wjuniorbh92 Jun 16, 2023
dbe1d9e
Fix: Add Asset in the Operation
wjuniorbh92 Jun 16, 2023
d14fd41
Fix: Add the sponsor public keys
wjuniorbh92 Jun 16, 2023
84ec56c
Fix: Fix Swag
wjuniorbh92 Jun 16, 2023
768071d
FIX: Remove the database function
wjuniorbh92 Jun 16, 2023
862e5c2
Merge branch 'T1A-106--Create-mint-route' of https://github.com/Chees…
wjuniorbh92 Jun 16, 2023
5933e9a
feat: forge asset
lucasmagnus Jun 20, 2023
d066001
feat: asset actions
lucasmagnus Jun 20, 2023
5ffe65d
feat: assets operations hooks
lucasmagnus Jun 20, 2023
0e6171c
feat: assets operations improvements
lucasmagnus Jun 21, 2023
6c78658
feat: forge asset
lucasmagnus Jun 22, 2023
b5b51df
Refactor: Add the feebump transaction
wjuniorbh92 Jun 22, 2023
2429f88
Refactor : Add feeBump transaction
wjuniorbh92 Jun 22, 2023
44a86f8
Fix: Add the Sponsor PK
wjuniorbh92 Jun 22, 2023
8bcdb08
Fix: Add Fee bump transaction
wjuniorbh92 Jun 22, 2023
c282332
Fix: Add Feebump Op
wjuniorbh92 Jun 22, 2023
a9dad3c
Merge pull request #9 from CheesecakeLabs/role-permission-allow-denie…
mvnthomaz Jun 22, 2023
1a92856
FEAT: Update Asset Flags
wjuniorbh92 Jun 26, 2023
8381456
Merge pull request #15 from CheesecakeLabs/feat_settings_and_roles
lucasmagnus Jun 27, 2023
80e98e5
Merge branch 'dev' into auth-add-email-and-settings
mvnthomaz Jun 27, 2023
ac7f636
Update role_permission_postgres.go
mvnthomaz Jun 27, 2023
b5fda7a
Merge pull request #17 from CheesecakeLabs/auth-add-email-and-settings
mvnthomaz Jun 28, 2023
046e4d8
Merge branch 'dev' into feat_manage_asset
Jun 29, 2023
0e28864
Refactor: Remove the Sponsor in the Brun Transaction
wjuniorbh92 Jul 6, 2023
e30eda0
Merge pull request #10 from CheesecakeLabs/T1A-107--Create-a-route-to…
wjuniorbh92 Jul 6, 2023
2e472d2
Merge pull request #11 from CheesecakeLabs/T1A-108--Payment-user-to-user
wjuniorbh92 Jul 6, 2023
384c71d
Merge branch 'T1A-106--Create-mint-route' into T1A-111--Create-a-Claw…
wjuniorbh92 Jul 6, 2023
9e6650d
Merge branch 'T1A-106--Create-mint-route' into T1A-111--Create-a-Claw…
wjuniorbh92 Jul 6, 2023
25da43a
Merge pull request #13 from CheesecakeLabs/T1A-111--Create-a-Clawback…
wjuniorbh92 Jul 6, 2023
4b053c6
Merge branch 'T1A-106--Create-mint-route' of https://github.com/Chees…
wjuniorbh92 Jul 6, 2023
b8624f5
Refactor: Create a new Mock
wjuniorbh92 Jul 6, 2023
e7d2a5e
Merge pull request #16 from CheesecakeLabs/T1A-58--Account-Authorization
wjuniorbh92 Jul 6, 2023
6290c70
Merge branch 'dev' into T1A-106--Create-mint-route
wjuniorbh92 Jul 6, 2023
87815b2
Merge branch 'T1A-106--Create-mint-route' of https://github.com/Chees…
wjuniorbh92 Jul 6, 2023
9e84c5f
Merge pull request #8 from CheesecakeLabs/T1A-106--Create-mint-route
wjuniorbh92 Jul 6, 2023
9e6d724
WIP API integration
Jul 10, 2023
95e8be4
Merge branch 'dev' into feat_manage_asset
Jul 10, 2023
8cec2af
Feat: Create a GetAll Assets
wjuniorbh92 Jul 10, 2023
b9f8de5
FEAT: Create a new request and add the option of Mint and SetFlags
wjuniorbh92 Jul 11, 2023
6212ba0
Merge pull request #18 from CheesecakeLabs/T1A-117--Create-Get-All-As…
wjuniorbh92 Jul 11, 2023
0aa0f44
Refactor: Add Name and Asset Type
wjuniorbh92 Jul 12, 2023
0cca6c7
Merge branch 'dev' into T1A-118--Update-create-asset-request
wjuniorbh92 Jul 12, 2023
fc32441
Refactor:Remove sponsorID required
wjuniorbh92 Jul 12, 2023
22de94c
Merge pull request #19 from CheesecakeLabs/T1A-118--Update-create-ass…
wjuniorbh92 Jul 12, 2023
74008be
WIP asset create
Jul 12, 2023
0e2cda6
Merge branch 'dev' into feat_manage_asset
Jul 12, 2023
e446283
WIP asset screen
Jul 14, 2023
6d41546
Refactor: Update the compose file to the dev env
wjuniorbh92 Jul 14, 2023
bede057
FIX: Docker-compose File
wjuniorbh92 Jul 17, 2023
75d7bcd
FIX: Change docker compose, to remove the networks
wjuniorbh92 Jul 17, 2023
cf65de0
WIP asset mgt
mvnthomaz Jul 18, 2023
ae970bd
Merge pull request #20 from CheesecakeLabs/Update-Docker-Compose-File
wjuniorbh92 Jul 18, 2023
37b5734
Refactor: Docker compose env
wjuniorbh92 Jul 18, 2023
75e456c
FIX: Refactor Env
wjuniorbh92 Jul 18, 2023
3b3cf91
Merge pull request #21 from CheesecakeLabs/Fix-Docker-compose
wjuniorbh92 Jul 18, 2023
264d473
Merge branch 'dev' into feat_manage_asset
mvnthomaz Jul 18, 2023
93c0d53
Edition users role added
mvnthomaz Jul 18, 2023
25d3928
FIX: Refactor the createAsset Query
wjuniorbh92 Jul 19, 2023
424cd70
Merge branch 'update-create-asset' of github.com:CheesecakeLabs/token…
mvnthomaz Jul 19, 2023
f8ac139
Refactor: Add const Asset in every transaction
wjuniorbh92 Jul 19, 2023
c07b41d
Merge branch 'update-create-asset' of github.com:CheesecakeLabs/token…
mvnthomaz Jul 19, 2023
5ec2cc1
WIP list assets
mvnthomaz Jul 19, 2023
5f46bb0
fix edit user role by permission
mvnthomaz Jul 19, 2023
90d6028
FIX: Remove Feebump Transactions
wjuniorbh92 Jul 20, 2023
b50f0c2
Refactor: Add the GetByID
wjuniorbh92 Jul 20, 2023
0ee4396
WIP asset mint endpoint
mvnthomaz Jul 20, 2023
3179360
Fmt print added
mvnthomaz Jul 20, 2023
1b29071
Merge branch 'update-create-asset' of github.com:CheesecakeLabs/token…
mvnthomaz Jul 20, 2023
78103aa
WIP integration
mvnthomaz Jul 20, 2023
88fa664
FIX: Add the correct topics
wjuniorbh92 Jul 20, 2023
a813f3b
FIX: Fix get all assets
wjuniorbh92 Jul 20, 2023
75aeb6b
FIX: Add a timeout header
wjuniorbh92 Jul 21, 2023
f550c6f
issuerPk added
mvnthomaz Jul 21, 2023
b86e8a9
FIX: Add the correct flags in the docs
wjuniorbh92 Jul 21, 2023
29d8829
WIP asset mgt
mvnthomaz Jul 21, 2023
21d148b
Fixes for DEMO
mvnthomaz Jul 21, 2023
70dd70a
front Fixes for demo
mvnthomaz Jul 21, 2023
5d13b68
Merge branch 'update-create-asset' of https://github.com/CheesecakeLa…
wjuniorbh92 Jul 24, 2023
4d9ea46
REFACTOR: Change the queries
wjuniorbh92 Jul 25, 2023
a956330
FIX: Add asset code in the query
wjuniorbh92 Jul 25, 2023
0529ee6
fix: sidebar highlight
lucasmagnus Jul 25, 2023
0509925
FIX: Add a error handle in the utils
wjuniorbh92 Jul 26, 2023
06b7752
FIX: Source and From in the Clawback op
wjuniorbh92 Jul 26, 2023
292e21e
Merge pull request #22 from CheesecakeLabs/update_users_role
lucasmagnus Jul 27, 2023
5795d01
feat: update design
lucasmagnus Jul 27, 2023
b5c9019
feat: vault caterogy
lucasmagnus Jul 27, 2023
3a59459
feat: vault page
lucasmagnus Jul 28, 2023
1dc54ec
feat: distribute vault
lucasmagnus Jul 30, 2023
7140ab6
feat: helper component
lucasmagnus Jul 31, 2023
149d530
Merge pull request #23 from CheesecakeLabs/update-create-asset
lucasmagnus Jul 31, 2023
2a768fc
feat: create vault
lucasmagnus Jul 31, 2023
d386d17
ADD: Add the Docs and Mocks
wjuniorbh92 Jul 31, 2023
d58b9ed
FEAT: Create a Vault Update Category endPoint
wjuniorbh92 Jul 31, 2023
9aa4050
Tests : Add the useCase Tests
wjuniorbh92 Jul 31, 2023
55aec94
Merge pull request #24 from CheesecakeLabs/vault_categories
lucasmagnus Jul 31, 2023
79f612c
feat: vault detail
lucasmagnus Jul 31, 2023
d56958d
Merge remote-tracking branch 'origin/dev' into feat_manage_asset
lucasmagnus Jul 31, 2023
709e757
Merge pull request #25 from CheesecakeLabs/feat_manage_asset
lucasmagnus Jul 31, 2023
0227e80
FIX: Functon params
wjuniorbh92 Aug 1, 2023
978d5ed
Merge branch 'dev' into update_vault_endpoint
wjuniorbh92 Aug 1, 2023
a86f935
Docs: Add the UpdateVaultAsset
wjuniorbh92 Aug 1, 2023
30a3639
🚧 : Add the stellar transaction to remove the auth_flag
wjuniorbh92 Aug 1, 2023
9030449
📝 : Add Swag
wjuniorbh92 Aug 2, 2023
d731537
feat: history payments
lucasmagnus Aug 2, 2023
afa41b2
feat: send distributor vault
lucasmagnus Aug 4, 2023
13dcb47
feat: get vault by ID
lucasmagnus Aug 7, 2023
324f074
Merge pull request #26 from CheesecakeLabs/update_vault_endpoint
wjuniorbh92 Aug 9, 2023
7eb2302
feat: create contract
lucasmagnus Aug 9, 2023
038ac79
feat: improvements vaults
lucasmagnus Aug 10, 2023
8db650f
feat: improvements assets
lucasmagnus Aug 11, 2023
131cc08
feat: change skeleton color
lucasmagnus Aug 11, 2023
6cfd3e7
feat: assets management flow
lucasmagnus Aug 11, 2023
e1e65ed
Merge pull request #27 from CheesecakeLabs/feat_vaults
lucasmagnus Aug 14, 2023
0e2424a
feat: update home asset
lucasmagnus Aug 14, 2023
2633a5e
feat: get asset by id
lucasmagnus Aug 14, 2023
16bbb18
icons and tag colors
fazzatti Aug 14, 2023
6bc72c9
locked asset
fazzatti Aug 14, 2023
cfd442a
Merge remote-tracking branch 'origin/dev' into feat_get_vault_by_id
lucasmagnus Aug 15, 2023
7868446
feat: edit vault
lucasmagnus Aug 15, 2023
d8dd9f6
♻️ Update the config file
wjuniorbh92 Aug 15, 2023
a289737
♻️ Add the Env frontend env
wjuniorbh92 Aug 15, 2023
d619d55
feat: delete vault
lucasmagnus Aug 16, 2023
34c612d
feat: vault detail changes
lucasmagnus Aug 16, 2023
fc1fde6
chore(backend): adjust Dockerfile
monteiro-alan Aug 17, 2023
b0decfb
chore(frontend): add Docker to Frontend
monteiro-alan Aug 17, 2023
1e8e2bb
Merge pull request #32 from CheesecakeLabs/chore/docker
monteiro-alan Aug 17, 2023
266095c
Merge pull request #31 from CheesecakeLabs/feat_smart_contracts
lucasmagnus Aug 18, 2023
fcbd04e
Merge pull request #30 from CheesecakeLabs/feat_get_vault_by_id
lucasmagnus Aug 18, 2023
2e6a09c
Merge branch 'dev' into update_config_env
wjuniorbh92 Aug 18, 2023
08592aa
🔀
wjuniorbh92 Aug 18, 2023
dddfa91
Merge pull request #29 from CheesecakeLabs/update_config_env
wjuniorbh92 Aug 18, 2023
e3d300f
ci(frontend): add --legacy-peer-deps to clean_install_dev Makefile co…
monteiro-alan Aug 18, 2023
7019421
ci(backend): add CI/CD
monteiro-alan Aug 18, 2023
ff36a73
ci(frontend): add CI/CD
monteiro-alan Aug 18, 2023
fb64eba
ci(kms): add CI/CD
monteiro-alan Aug 18, 2023
945bb41
ci(starlabs): add CI/CD
monteiro-alan Aug 18, 2023
1afa626
docs(infra): add CI/CD documentation
monteiro-alan Aug 18, 2023
5c36f1f
Merge pull request #34 from CheesecakeLabs/LABS-262_create_cicd_pipel…
monteiro-alan Aug 18, 2023
0586665
chore: upgrade KMS version 4021b62
monteiro-alan Aug 18, 2023
a086d35
Merge pull request #40 from CheesecakeLabs/chore/upgrade_kms_version
monteiro-alan Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
159 changes: 159 additions & 0 deletions .github/workflows/backend-cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Backend - CI/CD

on:
workflow_dispatch:
inputs:
run-type:
description: 'Run type'
required: true
default: 'Deploy'
type: choice
options:
- Code-Quality
- Deploy
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'backend/**.go'
- 'backend/**.mod'
- 'backend/**.sum'
- 'backend/Dockerfile'

defaults:
run:
working-directory: ./backend

jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.20"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
cache-dependency-path: ./backend/go.sum

# TODO: fix lint errors to remove `args: --issues-exit-code=0` to break the pipeline when lint errors are found
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
working-directory: ./backend
args: --issues-exit-code=0

# TODO: adjust project Docker Compose to tests work properly
# TODO: add make file commands to Backend
# - name: Run tests
# run: |
# go test ./...

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: backend/
platforms: linux/amd64
target: remote
push: false
tags: build:1.0.0
outputs: type=docker,dest=/tmp/docker_image.tar

- name: Upload artifact
uses: actions/upload-artifact@v3
if: inputs.run-type == 'Deploy'
with:
retention-days: 1
name: docker_image
path: /tmp/docker_image.tar

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: ['code-quality', 'build']
if: needs.code-quality.result == 'success' && needs.build.result == 'success' && inputs.run-type == 'Deploy'
environment: Production
env:
ECR_REPOSITORY: ${{ vars.resource_base_name }}-tfv2-backend
ECS_CLUSTER_NAME: ${{ vars.resource_base_name }}
ECS_SERVICE_NAME: ${{ vars.resource_base_name }}-tfv2-backend
ECS_CONTAINER_NAME: ${{ vars.resource_base_name }}-tfv2-backend
ECS_TASK_NAME: ${{ vars.resource_base_name }}-tfv2-backend
IMAGE_TAG: ${{ github.sha }}
permissions:
contents: 'read'

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Set image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: echo "IMAGE=$(echo $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG )" >> $GITHUB_ENV

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docker_image
path: /tmp

- name: Load, tag and push Docker image
run: |
docker load --input /tmp/docker_image.tar
docker tag build:1.0.0 ${{ env.IMAGE }}
docker image ls -a
docker push ${{ env.IMAGE }}

- name: Download ECS task definition
run: |
aws ecs describe-task-definition --task-definition $ECS_TASK_NAME --query taskDefinition > task-definition.json
cat task-definition.json

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: backend/task-definition.json
container-name: ${{ env.ECS_CONTAINER_NAME }}
image: ${{ env.IMAGE }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_NAME }}
cluster: ${{ env.ECS_CLUSTER_NAME }}
wait-for-service-stability: true
173 changes: 173 additions & 0 deletions .github/workflows/frontend-cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Frontend - CI/CD

on:
workflow_dispatch:
inputs:
run-type:
description: 'Run type'
required: true
default: 'Deploy'
type: choice
options:
- Code-Quality
- Deploy
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'frontend/**.js'
- 'frontend/**.ts'
- 'frontend/**.tsx'
- 'frontend/**.json'
- 'frontend/**.lock'
- 'frontend/src/**'
- 'frontend/Dockerfile'

defaults:
run:
working-directory: ./frontend

jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
strategy:
matrix:
node: ["16"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"

- name: Install dependencies
run: make clean_install_dev

# TODO: fix lint errors
# - name: Run Review Dog - Linter
# uses: reviewdog/action-eslint@v1
# with:
# level: "info"
# workdir: "./frontend/"
# fail_on_error: "true"

# TODO: fix lint errors
# - name: Run linter
# if: github.event_name != 'pull_request'
# run: make lint

# TODO: add tests and fix cogerage tests errors
# - name: Run coverage test
# run: make coverage-test

build:
name: Build
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: frontend/
platforms: linux/amd64
target: remote
push: false
tags: build:1.0.0
build-args: |
REACT_APP_API_URL=${{ vars.REACT_APP_API_URL }}
REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }}
outputs: type=docker,dest=/tmp/docker_image.tar

- name: Upload artifact
uses: actions/upload-artifact@v3
if: inputs.run-type == 'Deploy'
with:
retention-days: 1
name: docker_image
path: /tmp/docker_image.tar

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: ['code-quality', 'build']
if: needs.code-quality.result == 'success' && needs.build.result == 'success' && inputs.run-type == 'Deploy'
environment: Production
env:
ECR_REPOSITORY: ${{ vars.resource_base_name }}-tfv2-frontend
ECS_CLUSTER_NAME: ${{ vars.resource_base_name }}
ECS_SERVICE_NAME: ${{ vars.resource_base_name }}-tfv2-frontend
ECS_CONTAINER_NAME: ${{ vars.resource_base_name }}-tfv2-frontend
ECS_TASK_NAME: ${{ vars.resource_base_name }}-tfv2-frontend
IMAGE_TAG: ${{ github.sha }}
permissions:
contents: 'read'

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Set image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: echo "IMAGE=$(echo $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG )" >> $GITHUB_ENV

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docker_image
path: /tmp

- name: Load, tag and push Docker image
run: |
docker load --input /tmp/docker_image.tar
docker tag build:1.0.0 ${{ env.IMAGE }}
docker image ls -a
docker push ${{ env.IMAGE }}

- name: Download ECS task definition
run: |
aws ecs describe-task-definition --task-definition $ECS_TASK_NAME --query taskDefinition > task-definition.json
cat task-definition.json

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: frontend/task-definition.json
container-name: ${{ env.ECS_CONTAINER_NAME }}
image: ${{ env.IMAGE }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_NAME }}
cluster: ${{ env.ECS_CLUSTER_NAME }}
wait-for-service-stability: true
Loading
Loading