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

Fix/round matching #1868

Closed
wants to merge 602 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
602 commits
Select commit Hold shift + click to select a range
df75268
add qacc validation to draft donation resolver
ae2079 Sep 26, 2024
a8e00f1
fix tests
ae2079 Sep 26, 2024
345f2d1
Update src/repositories/projectRoundRecordRepository.test.ts
aminlatifi Sep 26, 2024
b254f6b
Changed getCumulativePastRoundsDonationAmounts query
aminlatifi Sep 26, 2024
fdc1198
Merge branch 'feat/contribution-cap' of https://github.com/GeneralMag…
aminlatifi Sep 26, 2024
1da2c9e
Merge pull request #68 from GeneralMagicio/feat/contribution-cap
aminlatifi Sep 26, 2024
5a7b2ea
adding starting date check in query for round token price
kkatusic Sep 26, 2024
c042c67
added constant for token name
kkatusic Sep 26, 2024
9277407
Added projectUserRecord and its repository
aminlatifi Sep 26, 2024
61624c2
Moved qacc constants to separate file
aminlatifi Sep 26, 2024
4361a5c
Merge pull request #69 from GeneralMagicio/addNFTConditionToDraftDona…
ae2079 Sep 26, 2024
be63d44
Merge branch 'staging' into feat/setup_token_price_column_round
kkatusic Sep 26, 2024
f9071cb
fixing build errors
kkatusic Sep 26, 2024
53ff13d
Added projectUserRecode to user resolver
aminlatifi Sep 26, 2024
99a73ad
Merge branch 'staging' of https://github.com/GeneralMagicio/QAcc-BE i…
aminlatifi Sep 26, 2024
169263b
add new fields to early access round and qf round tables
ae2079 Sep 27, 2024
38248a1
add migration for adding round caps
ae2079 Sep 27, 2024
4d5bf1a
update early access round repository tests
ae2079 Sep 27, 2024
1f9697e
make new fields nullable
ae2079 Sep 27, 2024
cacb46d
update qf round repository tests
ae2079 Sep 27, 2024
014dc02
update migration to make new fields nullable
ae2079 Sep 27, 2024
571aca9
update rounds resolver tests
ae2079 Sep 27, 2024
7f2687c
Merge branch 'staging' into feat/setup_token_price_column_round
aminlatifi Sep 27, 2024
aee9d42
Fixed import issue
aminlatifi Sep 27, 2024
aa5e9b2
Merge pull request #65 from GeneralMagicio/feat/setup_token_price_col…
kkatusic Sep 27, 2024
9258509
Added fix add token price to rounds
aminlatifi Sep 27, 2024
9ba7f4b
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into AddR…
ae2079 Sep 29, 2024
0cf6243
remove redundant POLPriceAtRoundStart field and use tokenPrice instea…
ae2079 Sep 29, 2024
85d8d63
Update ProjectUserRecord and related resolvers
aminlatifi Sep 29, 2024
9f8be62
Merge branch 'staging' into feat/contribution-cap
aminlatifi Sep 29, 2024
78ddc0d
Made qf slug unique in tests
aminlatifi Sep 29, 2024
632dbee
Added round number generator
aminlatifi Sep 29, 2024
aa9a019
Fixed an issue in importing
aminlatifi Sep 29, 2024
d3d5854
Added project user record migration
aminlatifi Sep 29, 2024
adc0894
Merge pull request #71 from GeneralMagicio/feat/contribution-cap
aminlatifi Sep 29, 2024
b1b2516
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into AddR…
ae2079 Sep 29, 2024
7526438
add virtual fields for cumulative caps
ae2079 Sep 29, 2024
da4bb4a
update tests based on the changes
ae2079 Sep 29, 2024
e3cf638
Fixed cumulutive values for qfRound and EA roudns
aminlatifi Sep 29, 2024
21325d5
Merge pull request #70 from GeneralMagicio/AddRoundCaps
aminlatifi Sep 29, 2024
52b76d6
add mock report based on the test data
ae2079 Sep 29, 2024
0f37edf
sync the reward amounts based on the report json file
ae2079 Sep 29, 2024
d634546
fix unit test
ae2079 Sep 29, 2024
30b40a6
remove redundant comments
ae2079 Sep 29, 2024
1549045
find reports based on round number
ae2079 Sep 29, 2024
87bfdf8
Added qAcc service for allowed donate amount
aminlatifi Sep 29, 2024
c9b3826
add simple git lib
ae2079 Sep 30, 2024
df1d265
pull the reports from github repo
ae2079 Sep 30, 2024
e334e18
Don't throw error on missed project round records
aminlatifi Sep 30, 2024
fb1e414
Fixed issue in schema
aminlatifi Sep 30, 2024
8ab8243
Updated graphql schema
aminlatifi Sep 30, 2024
38d76dc
Revert change in ProjectRoundRecord query
aminlatifi Sep 30, 2024
74382aa
Merge pull request #73 from GeneralMagicio/feat/userDonateCap
aminlatifi Sep 30, 2024
98c01eb
Renamed variables and added comments
aminlatifi Sep 30, 2024
4465569
Renamed variables and added comments
aminlatifi Sep 30, 2024
7d7bb1f
Added qacc resolver projectUserDonationCap api
aminlatifi Sep 30, 2024
c992089
Integrated qacc limit with the donation creation api
aminlatifi Sep 30, 2024
b9b325c
Removed .only
aminlatifi Sep 30, 2024
0d91977
Fixed issue in draft donation tests
aminlatifi Sep 30, 2024
4b22d80
Merge pull request #75 from GeneralMagicio/feat/qacc-cap-api
aminlatifi Sep 30, 2024
7cf68d7
Added price fetch cron job
aminlatifi Oct 1, 2024
0c8636a
Implemented lead time for round price fetching
aminlatifi Oct 1, 2024
2330d56
Merge pull request #76 from GeneralMagicio/feat/round-price-fetch-job
aminlatifi Oct 1, 2024
893e610
add cumulative donations to the round records
ae2079 Oct 1, 2024
c1b61cb
Merge pull request #72 from GeneralMagicio/ChangeInverterScriptToRunW…
ae2079 Oct 1, 2024
c0ddfa4
Merge pull request #77 from GeneralMagicio/AddCumulativeDonationAmounts
ae2079 Oct 1, 2024
a8a539c
remove flag for calculating donation amounts
ae2079 Oct 1, 2024
cbaa87d
update cumulative donation amounts in update round record method
ae2079 Oct 1, 2024
b106344
Merge pull request #78 from GeneralMagicio/fixCumulativeDonationAmount
aminlatifi Oct 1, 2024
351837f
Cached early access round after load query
aminlatifi Oct 1, 2024
ac0abf5
Disable cache in test env
aminlatifi Oct 1, 2024
7f53964
Initialize project round record if not exists
aminlatifi Oct 1, 2024
da0683d
Updated the tests according to update in the query
aminlatifi Oct 1, 2024
c5c9f07
Merge pull request #79 from GeneralMagicio/feat/cache-early-access-af…
aminlatifi Oct 1, 2024
c86b141
Merge pull request #80 from GeneralMagicio/fix/project-round-record-i…
aminlatifi Oct 1, 2024
fc9573b
Fixed log message
aminlatifi Oct 2, 2024
11966c4
Fixed issue in fill price query
aminlatifi Oct 2, 2024
e9b4104
Updated condition of active qf round
aminlatifi Oct 2, 2024
0e3575b
Updated test according to change
aminlatifi Oct 2, 2024
f768aa5
Fixed issue in test
aminlatifi Oct 2, 2024
ba7b269
Merge pull request #81 from GeneralMagicio/feat/change-qf-round-activ…
aminlatifi Oct 2, 2024
fa02159
All projects are particpated to qfRound
aminlatifi Oct 2, 2024
de17313
Merge branch 'staging' into feat/change-qf-round-active-rule
aminlatifi Oct 2, 2024
5efa395
Removed qfRound connection to projects in some tests
aminlatifi Oct 2, 2024
2135130
Merge pull request #82 from GeneralMagicio/feat/change-qf-round-activ…
aminlatifi Oct 2, 2024
6c26d39
Fixed build issue
aminlatifi Oct 2, 2024
3ab24ef
Fixed qf round user cap limit for ea donors
aminlatifi Oct 2, 2024
3fd8fb4
Merge pull request #83 from GeneralMagicio/fix/qacc-user-cap-limit
aminlatifi Oct 2, 2024
5a1f9fa
add new error messages
ae2079 Oct 2, 2024
bbb549f
throw error when round does not started
ae2079 Oct 2, 2024
69f32d1
fix tests
ae2079 Oct 2, 2024
8b73cb3
skip the failed tests for now
ae2079 Oct 2, 2024
7653628
Merge pull request #84 from GeneralMagicio/FixCumulativeAmountIssue
ae2079 Oct 2, 2024
3b2f20d
delete donations with early access rounds
ae2079 Oct 2, 2024
996e8c0
Merge pull request #85 from GeneralMagicio/fixQaccServiceTests
ae2079 Oct 3, 2024
b4f3d9d
remove redundant conditions
ae2079 Oct 3, 2024
49d29a3
Merge pull request #86 from GeneralMagicio/removeRedundantCondition
ae2079 Oct 3, 2024
5f52710
Fixed a message
aminlatifi Oct 3, 2024
a0630d6
Fixed issue in qf round project cap limit
aminlatifi Oct 6, 2024
efdd75a
Changed default tokenPrice
aminlatifi Oct 6, 2024
7eda067
Changed default token price in qAcc cap calculation
aminlatifi Oct 6, 2024
216c6c1
Did some refactoring
aminlatifi Oct 6, 2024
8ea981d
Added more tests
aminlatifi Oct 6, 2024
a051ec0
Merge pull request #87 from GeneralMagicio/fix/qf-round-project-cap
aminlatifi Oct 6, 2024
47d669c
Fixed cap issue
aminlatifi Oct 7, 2024
a02bf0e
Changed cumulativeCapPerProject query cache time
aminlatifi Oct 7, 2024
a1d9683
Merge pull request #88 from GeneralMagicio/fix/cap-issue
aminlatifi Oct 7, 2024
0acceb7
Added TYPEORM_DISABLE_SSL feature
aminlatifi Oct 8, 2024
5e20ed8
Renamed cumulativeCapPerProject to cumulativeUSDCapPerProject
aminlatifi Oct 8, 2024
26c7861
Updated qacc service according to qf round close cap
aminlatifi Oct 8, 2024
9799005
Update test according to changes
aminlatifi Oct 8, 2024
efba9c3
Merge pull request #89 from GeneralMagicio/feat/qf-round-close-cap
aminlatifi Oct 8, 2024
c85bc33
Updated test to check fraction support in donation value
aminlatifi Oct 8, 2024
e81d91e
Change update of create query of projectUserRecord
aminlatifi Oct 9, 2024
b710c3b
Updated updateOrCreateProjectUserRecord to single one
aminlatifi Oct 9, 2024
5a99251
Change query to single raw query
aminlatifi Oct 9, 2024
fa0f53f
Updated updateOrCreateProjectRoundRecord
aminlatifi Oct 9, 2024
24b26e1
Fixed default value initialization
aminlatifi Oct 9, 2024
55abe59
Merge pull request #90 from GeneralMagicio/feat/improve-queries
aminlatifi Oct 9, 2024
f78a19d
Merge branch 'main' into staging
geleeroyale Oct 9, 2024
1a864ab
Merge pull request #45 from GeneralMagicio/staging
ae2079 Oct 9, 2024
9011ea2
fix some bugs in script
ae2079 Oct 10, 2024
3b642be
skip the test, because for the donation rewards, we need a mock report
ae2079 Oct 10, 2024
f28a591
get round number from input args
ae2079 Oct 10, 2024
f76682f
Merge pull request #91 from GeneralMagicio/fixBugsInSyncWithReport
aminlatifi Oct 10, 2024
895dda5
Used optional chaining for type can be undefied
aminlatifi Oct 11, 2024
b67de0e
Merge branch 'staging'
aminlatifi Oct 11, 2024
4ded653
Better error handling on processing authentication token
aminlatifi Oct 11, 2024
1bd1c76
Remove ssl disable switch
aminlatifi Oct 11, 2024
c2e9747
add required configs for funding pot execution to the env variables
ae2079 Oct 14, 2024
6511b96
refactor previous script to read the configs from common file and rep…
ae2079 Oct 14, 2024
c8c9022
add a script to create all the needed things to run the funding pot s…
ae2079 Oct 14, 2024
a3a662b
add execute:inverter:production command to the package.json file
ae2079 Oct 14, 2024
4960c86
remove funding pot env variables from mandatory variables
ae2079 Oct 14, 2024
ca98e80
Handle empty privadoVerifiedRequestIds field
aminlatifi Oct 14, 2024
b0fed95
Merge pull request #96 from GeneralMagicio/staging
aminlatifi Oct 14, 2024
ebc2c67
Create main-deploy-only.yml
geleeroyale Oct 14, 2024
2f70c31
Force recreate on prodction deploy only scripts
aminlatifi Oct 14, 2024
e3df161
Merge pull request #97 from GeneralMagicio/feat/force-recreate-main-d…
geleeroyale Oct 14, 2024
8dcbb2b
Merge branch 'main' into staging
aminlatifi Oct 14, 2024
f20e700
Upgraded axios dependencies
aminlatifi Oct 14, 2024
e1f70bf
change funding pot repo url to inverter repo
ae2079 Oct 15, 2024
2b52750
move helper functions to helper file
ae2079 Oct 15, 2024
a3898b5
generate batch configs automatic based on rounds data
ae2079 Oct 15, 2024
d5a52e0
use upper case and snake case from lodash
ae2079 Oct 15, 2024
1bcc6dd
fix bug
ae2079 Oct 15, 2024
9ee14aa
revert the changes related to use lodash
ae2079 Oct 15, 2024
af8aad1
Merge pull request #95 from GeneralMagicio/runFundingPotAutomatic
ae2079 Oct 15, 2024
c581f8c
Fix missing param in batch configs of funding pot service
ae2079 Oct 15, 2024
1cd612a
Fix bug in vesting time calculation
ae2079 Oct 16, 2024
ce9f212
adjust stream dates based on what tam said
ae2079 Oct 16, 2024
bb16eba
adjust changes on report by Fabi
ae2079 Oct 17, 2024
71b6c37
Merge branch 'staging' of github.com:GeneralMagicio/QAcc-BE into adju…
ae2079 Oct 17, 2024
8f15b04
add isBatchMintingExecuted field to the rounds tables
ae2079 Oct 17, 2024
54cf6ef
calculate batch number automatically and support only report flag
ae2079 Oct 17, 2024
a21e788
Merge pull request #99 from GeneralMagicio/adjustVestingDates
aminlatifi Oct 17, 2024
2dd1cb6
Updated cap calculation logic
aminlatifi Oct 18, 2024
d4871fd
Update cap records after donation is failed
aminlatifi Oct 18, 2024
1b925b0
Skipped isWalletAddressSmartContractTestCases
aminlatifi Oct 18, 2024
ab246dd
Merge pull request #101 from GeneralMagicio/feat/include-pending-dona…
aminlatifi Oct 18, 2024
98149fd
Update qacc capps after a pending donation is made
aminlatifi Oct 18, 2024
b8fef8d
Merge branch 'staging' into feat/include-pending-donation-in-cap
aminlatifi Oct 18, 2024
17645fc
Merge pull request #102 from GeneralMagicio/feat/include-pending-dona…
aminlatifi Oct 18, 2024
9a36a95
Fixed issues with donation resovler test
aminlatifi Oct 18, 2024
5bcc552
Fixed issue in update place
aminlatifi Oct 18, 2024
143bada
Merge pull request #103 from GeneralMagicio/feat/include-pending-dona…
ae2079 Oct 18, 2024
3044e66
handle NaN in reward amount calculation
ae2079 Oct 20, 2024
d35dd60
make env compatible with polygon zkEVM
ae2079 Oct 21, 2024
8bcd7b5
Remove test files
ae2079 Oct 21, 2024
113c95c
Remove sync reports from sync script
ae2079 Oct 21, 2024
a3f8cd2
Sync data with reports after batch minting execution
ae2079 Oct 21, 2024
8e43138
Add sync data with indexer cronjob
ae2079 Oct 21, 2024
480cf3c
Add funding pot execution to github actions
ae2079 Oct 22, 2024
4a98e55
Rename action
ae2079 Oct 22, 2024
7142a51
Merge pull request #104 from GeneralMagicio/SyncDataAfterBatchMinting
aminlatifi Oct 22, 2024
176a445
Merge pull request #105 from GeneralMagicio/AddFundingPotExecutionToG…
aminlatifi Oct 22, 2024
2ec5ad1
Added logs
aminlatifi Oct 22, 2024
14073e5
Prevent undefined issue
aminlatifi Oct 22, 2024
ea155c4
Upgraded node-cron
aminlatifi Oct 22, 2024
3f4f573
fix bug in calculating token price
ae2079 Oct 22, 2024
db85966
Merge pull request #106 from GeneralMagicio/FixBugInABCTokenPrice
aminlatifi Oct 22, 2024
5b0f6c1
Fixed issue in matching pending donation and updating project round r…
aminlatifi Oct 23, 2024
333c2db
Merge pull request #107 from GeneralMagicio/fix/match-pending-donation
aminlatifi Oct 23, 2024
19a58f6
Added more logs
aminlatifi Oct 23, 2024
79b700a
change round caps to be cumulative for ea rounds
ae2079 Oct 24, 2024
e735d3c
Merge pull request #108 from GeneralMagicio/fixIssueInRoundCapsForBat…
ae2079 Oct 24, 2024
f2158b9
Accept donations without round matching
aminlatifi Oct 24, 2024
0220700
Accept donations without round matching
aminlatifi Oct 24, 2024
9a4bcaf
Merge branch 'feat/refactor-donation-flow' of https://github.com/Gene…
aminlatifi Oct 24, 2024
d31fff8
Fixed linting issues
aminlatifi Oct 27, 2024
2e82a0c
Fixed failing tests
aminlatifi Oct 27, 2024
740b60c
Updated tests to support POL token on chain verification
aminlatifi Oct 27, 2024
eff5d79
Added test for matching with ea and qf round on verification
aminlatifi Oct 27, 2024
095d49a
use spawn instead of exec to show realtime logs
ae2079 Oct 27, 2024
d97e4ce
update stream times based on production values
ae2079 Oct 27, 2024
ffe23ef
add number of batch minting to the project table
ae2079 Oct 28, 2024
31ca0ff
add migration for adding number of batch minting to the project table
ae2079 Oct 28, 2024
44eb352
fill number of batch minting transaction numbers in the sync script
ae2079 Oct 28, 2024
33cd371
Merge branch 'staging' into feat/refactor-donation-flow
aminlatifi Oct 28, 2024
dc067a5
Merge pull request #109 from GeneralMagicio/feat/refactor-donation-flow
aminlatifi Oct 28, 2024
5ab9da7
Merge branch 'staging' into setCorrectStreamingDates
aminlatifi Oct 28, 2024
4036da5
Merge pull request #110 from GeneralMagicio/setCorrectStreamingDates
aminlatifi Oct 28, 2024
e6630f7
Merge pull request #111 from GeneralMagicio/SaveNumberOfBatchMintingT…
aminlatifi Oct 28, 2024
2abc123
Used donation time in validating the donations
aminlatifi Oct 28, 2024
b0cbd1d
Fixed issue in calling qac validator on draft donation resolver
aminlatifi Oct 28, 2024
9de38ce
Merge pull request #112 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 28, 2024
93c9072
create output directory in funding pot production directory to save r…
ae2079 Oct 28, 2024
1bfe0e4
Accept donations don't match with rounds
aminlatifi Oct 29, 2024
aa1e4d4
Merge branch 'staging' into feat/import-missed-donations
aminlatifi Oct 29, 2024
3872ed3
Remove .only from atest
aminlatifi Oct 29, 2024
d0f7851
Merge branch 'feat/import-missed-donations' of https://github.com/Gen…
aminlatifi Oct 29, 2024
4d70d3a
Merge pull request #113 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 29, 2024
b53d442
Added sync with ankr feature
aminlatifi Oct 29, 2024
9bf7460
Remove the api key
aminlatifi Oct 29, 2024
c965100
Merge branch 'staging' into feat/import-missed-donations
aminlatifi Oct 29, 2024
948b65e
Added ENABLE_ANKR_SYNC support
aminlatifi Oct 29, 2024
3f2a1ec
Merge branch 'feat/import-missed-donations' of https://github.com/Gen…
aminlatifi Oct 29, 2024
744a771
Changed donation source to CHAIN for those synced by ankr
aminlatifi Oct 29, 2024
011d251
Skip not needed test
aminlatifi Oct 29, 2024
258fb05
Merge pull request #114 from GeneralMagicio/feat/import-missed-donations
aminlatifi Oct 29, 2024
bdb0a83
Added ankr state migration
aminlatifi Oct 29, 2024
13b62ba
Fixed a fix
aminlatifi Oct 29, 2024
65dd43d
Fixed an issue
aminlatifi Oct 29, 2024
ee14989
Fixed issue in finding round in create donation
aminlatifi Oct 29, 2024
0b66cba
addes sorting field enums
lovelgeorge99 Oct 29, 2024
ee60ee9
Merge pull request #115 from GeneralMagicio/fix/create-donation-round…
ae2079 Oct 30, 2024
27e4537
Change numberOfBatchMintingTransactions column in project to batchNum…
ae2079 Oct 30, 2024
77c9dd5
add auto generated migration for the field changes
ae2079 Oct 30, 2024
d81e71c
fix type of graphql field
ae2079 Oct 30, 2024
5a7e3d7
Merge pull request #116 from GeneralMagicio/fix-sorting-donation
aminlatifi Oct 30, 2024
d85dc29
Merge pull request #118 from GeneralMagicio/addBatchNumbersWithTXsToP…
aminlatifi Oct 30, 2024
3b61a3c
Added flag for enabling jobs or graphql server
aminlatifi Oct 31, 2024
5de974f
Enabled graphql and job mode in test env
aminlatifi Oct 31, 2024
c2661ca
Updated staging docker-compose
aminlatifi Oct 31, 2024
89226f1
updated local run docker compose
aminlatifi Oct 31, 2024
4bd9ee7
Updated example env
aminlatifi Oct 31, 2024
41293c5
Merge pull request #119 from GeneralMagicio/feat/run-mode
aminlatifi Oct 31, 2024
6072ad8
FIxed log directory
aminlatifi Oct 31, 2024
b38f532
Merge branch 'staging' into feat/run-mode
aminlatifi Oct 31, 2024
3d7a356
Merge pull request #120 from GeneralMagicio/feat/run-mode
aminlatifi Oct 31, 2024
716556b
Added a log
aminlatifi Oct 31, 2024
72325c1
Added a try catch to have a save donation insert in importing from ch…
aminlatifi Oct 31, 2024
bffdcda
Added redis to test profile of test
aminlatifi Oct 31, 2024
79ef1bb
Fixed round matching issues
aminlatifi Oct 31, 2024
e7d08a3
Merge pull request #121 from GeneralMagicio/fix/round-matching
aminlatifi Oct 31, 2024
d7411d4
Removed extra check in donation validation
aminlatifi Oct 31, 2024
dff77cb
Merge branch 'staging' into fix/round-matching
aminlatifi Oct 31, 2024
49b6820
Fixed failed test
aminlatifi Oct 31, 2024
0e27d3a
Merge branch 'fix/round-matching' of https://github.com/GeneralMagici…
aminlatifi Oct 31, 2024
fb5d1dc
Fixed issue in calculating project user record
aminlatifi Oct 31, 2024
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
  •  
  •  
  •  
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MY_URL="https://mydomain.com"
IP_WHITELIST="0.0.0.0/0"
111 changes: 0 additions & 111 deletions .github/workflows/develop-pipeline.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/main-deploy-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: main-deploy-only

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd QAcc-BE
git checkout main
git pull
docker compose -f docker-compose-production.yml pull
docker compose -f docker-compose-production.yml up --force-recreate -d
docker image prune -a --force
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
name: master-pipeline
name: main-pipeline

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20.11.0

# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm ci

- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: true
#prettier: true
continue_on_error: true

test:
runs-on: ubuntu-latest
needs: run-linters
services:
# Label used to access the service container
redis:
Expand All @@ -30,7 +55,7 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: givethio
POSTGRES_DB: qacc
PGDATA: /var/lib/postgresql/data/pgdata
options: >-
--health-cmd pg_isready
Expand All @@ -43,22 +68,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_S3_REGION }}

- name: Download latest DB backup from S3
run: |
FILENAME=$(aws s3 ls ${{ secrets.AWS_S3_BUCKET_PATH_PROD }}/ | sort | tail -n 1 | awk '{print $4}')
aws s3 cp ${{ secrets.AWS_S3_BUCKET_PATH_PROD }}/$FILENAME /tmp/db_backup.zip

- name: Unzip DB backup
run: |
unzip /tmp/db_backup.zip -d /tmp
mv /tmp/backups/givethio-db/*.sql /tmp/backups/givethio-db/db_backup.sql

- name: Wait for PostgreSQL to become ready
run: |
Expand All @@ -69,9 +78,6 @@ jobs:
sleep 1
done

- name: Restore DB backup
run: PGPASSWORD=postgres psql -h localhost -p 5443 -U postgres -d givethio < /tmp/backups/givethio-db/db_backup.sql

- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -108,32 +114,36 @@ jobs:
ZKEVM_CARDONA_SCAN_API_KEY: ${{ secrets.ZKEVM_CARDONA_SCAN_API_KEY }}
MORDOR_ETC_TESTNET: ${{ secrets.MORDOR_ETC_TESTNET }}
ETC_NODE_HTTP_URL: ${{ secrets.ETC_NODE_HTTP_URL }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_PROD }}
DROP_DATABASE: ${{ secrets.DROP_DATABASE_DURING_TEST_STAGING }}
SOLANA_TEST_NODE_RPC_URL: ${{ secrets.SOLANA_TEST_NODE_RPC_URL }}
SOLANA_DEVNET_NODE_RPC_URL: ${{ secrets.SOLANA_DEVNET_NODE_RPC_URL }}
SOLANA_MAINNET_NODE_RPC_URL: ${{ secrets.SOLANA_MAINNET_NODE_RPC_URL }}
MPETH_GRAPHQL_PRICES_URL: ${{ secrets.MPETH_GRAPHQL_PRICES_URL }}
GIV_POWER_SUBGRAPH_URL: ${{ secrets.GIV_POWER_SUBGRAPH_URL }}

PRIVADO_VERIFIER_NETWORK_ID: ${{ secrets.PRIVADO_VERIFIER_NETWORK_ID }}
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Build image and push to GitHub Packages
uses: docker/build-push-action@v1
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ github.token }}
registry: ghcr.io
repository: giveth/impact-graph
add_git_labels: true
# Add branch name to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_ref}
tag_with_ref: true
# Add commit hash to docker image tag @see{@link https://github.com/docker/build-push-action/tree/releases/v1#tag_with_sha}
tag_with_sha: true
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/generalmagicio/qacc-be:main

deploy:
needs: publish
Expand All @@ -142,13 +152,14 @@ jobs:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_HOST_ALL }}
username: ${{ secrets.PROD_USERNAME_ALL }}
key: ${{ secrets.PROD_PRIVATE_KEY_ALL }}
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd giveth-all
docker compose stop impact-graph
docker compose pull impact-graph
docker compose up -d impact-graph
cd QAcc-BE
git checkout main
git pull
docker compose -f docker-compose-production.yml pull
docker compose -f docker-compose-production.yml up -d
docker image prune -a --force
70 changes: 70 additions & 0 deletions .github/workflows/main-publish-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: publish-deploy-main-branch

on:
workflow_dispatch:

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20.11.0

# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm ci

- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: true
#prettier: true
continue_on_error: true

publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/generalmagicio/qacc-be:main

deploy:
needs: publish
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd QAcc-BE
git checkout main
git pull
docker compose -f docker-compose-production.yml pull
docker compose -f docker-compose-production.yml up --force-recreate -d
docker image prune -a --force
Loading