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

RK3 #9

Merged
merged 241 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
213bec9
add validate
DmitriyKomarovCoder Nov 8, 2023
5edceca
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 8, 2023
2c8f064
los delete && cd start
CodeMaster482 Nov 9, 2023
92de501
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
CodeMaster482 Nov 9, 2023
87a9689
CD stage && stop track .env ...
CodeMaster482 Nov 9, 2023
ed4caa5
CD test
CodeMaster482 Nov 9, 2023
0bc91a5
Cd typo hot fix
CodeMaster482 Nov 9, 2023
6f92e8d
cd test 2
CodeMaster482 Nov 9, 2023
96fc6cf
cd test 3
CodeMaster482 Nov 9, 2023
585ba13
cd test 4
CodeMaster482 Nov 9, 2023
1422f20
cd dockerhub test
CodeMaster482 Nov 9, 2023
4b60c91
cd deploy try
CodeMaster482 Nov 9, 2023
11449ba
cd deploy test
CodeMaster482 Nov 9, 2023
4671856
cd debug
CodeMaster482 Nov 9, 2023
2310647
CD debug
CodeMaster482 Nov 9, 2023
b2bfda1
cd debug stage
CodeMaster482 Nov 9, 2023
833c97d
cd test
CodeMaster482 Nov 9, 2023
9b927fd
cd test
CodeMaster482 Nov 9, 2023
62a1e7c
cd test
CodeMaster482 Nov 9, 2023
36fe950
cd test
CodeMaster482 Nov 10, 2023
0323ed3
cd test
CodeMaster482 Nov 10, 2023
ed44b3c
cd test
CodeMaster482 Nov 10, 2023
f5bfcc3
cd test
CodeMaster482 Nov 10, 2023
b7b1cc7
cd test
CodeMaster482 Nov 10, 2023
651169c
cd test
CodeMaster482 Nov 10, 2023
4846e9f
cd test
CodeMaster482 Nov 10, 2023
d54b4a0
cd test
CodeMaster482 Nov 10, 2023
5757d9f
cd test
CodeMaster482 Nov 10, 2023
e45ffbf
cd test
CodeMaster482 Nov 10, 2023
e802a69
cd test
CodeMaster482 Nov 10, 2023
bd6e2e6
cd test
CodeMaster482 Nov 10, 2023
a52ad68
cd test
CodeMaster482 Nov 10, 2023
91c1913
cd test
CodeMaster482 Nov 10, 2023
4d195d4
cd test
CodeMaster482 Nov 10, 2023
ba95b9d
cd test
CodeMaster482 Nov 10, 2023
9e5d5f5
cd test
CodeMaster482 Nov 10, 2023
c22f815
cd test
CodeMaster482 Nov 10, 2023
5bf1c7d
cd test
CodeMaster482 Nov 10, 2023
38c1dd5
add validate
DmitriyKomarovCoder Nov 10, 2023
c762656
cd test
CodeMaster482 Nov 10, 2023
d8b778e
cd test
CodeMaster482 Nov 10, 2023
3e09b64
cd test
CodeMaster482 Nov 10, 2023
63f1c46
cd test
CodeMaster482 Nov 10, 2023
000e34b
cd test
CodeMaster482 Nov 10, 2023
586574e
cd test
CodeMaster482 Nov 10, 2023
e19a489
cd test
CodeMaster482 Nov 10, 2023
b33dfb4
cd test
CodeMaster482 Nov 10, 2023
f58d2c7
cd test
CodeMaster482 Nov 10, 2023
72f1a5a
cd test
CodeMaster482 Nov 10, 2023
2714ea2
cd test
CodeMaster482 Nov 10, 2023
f096874
cd test
CodeMaster482 Nov 10, 2023
fa693db
cd test
CodeMaster482 Nov 10, 2023
aaba5fe
cd teast
CodeMaster482 Nov 10, 2023
1e08ea1
cd test
CodeMaster482 Nov 10, 2023
d99eeb9
cd test
CodeMaster482 Nov 10, 2023
50f4449
cd
CodeMaster482 Nov 10, 2023
d707181
cdcdcdcdcdcdcddcdcdcdcdcdc
CodeMaster482 Nov 10, 2023
f7d2b54
cd
CodeMaster482 Nov 10, 2023
43750b5
cd test
CodeMaster482 Nov 11, 2023
4a6b8a6
cd test
CodeMaster482 Nov 11, 2023
2f8951c
cd try №993
CodeMaster482 Nov 12, 2023
08d9d30
cd try && make file update && covarege upgrade
CodeMaster482 Nov 12, 2023
dbaa94c
filnnale cd
CodeMaster482 Nov 12, 2023
f72c012
lint cd add
CodeMaster482 Nov 12, 2023
eb91314
cd
CodeMaster482 Nov 12, 2023
ff7eb80
cd
CodeMaster482 Nov 12, 2023
3c3b70e
merge auto cd
CodeMaster482 Nov 12, 2023
27a1f97
append file
CodeMaster482 Nov 12, 2023
33e0378
edit test
DmitriyKomarovCoder Nov 12, 2023
20c1b22
helthcheck upgrade
CodeMaster482 Nov 12, 2023
2189fec
auth hotfix
CodeMaster482 Nov 12, 2023
379468e
deploy
CodeMaster482 Nov 12, 2023
410f5ce
makefile update
CodeMaster482 Nov 12, 2023
1a6320d
test rm todo:change test helthcheck
CodeMaster482 Nov 12, 2023
493d329
deploy
CodeMaster482 Nov 12, 2023
6649582
deploy
CodeMaster482 Nov 12, 2023
f60ee4e
deploy
CodeMaster482 Nov 12, 2023
0ee5d13
deploy
DmitriyKomarovCoder Nov 12, 2023
a227b9f
add .env
DmitriyKomarovCoder Nov 12, 2023
6242040
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
e6a6cf5
add .env
DmitriyKomarovCoder Nov 12, 2023
8f48910
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
a7449d6
i am девопсер
DmitriyKomarovCoder Nov 12, 2023
af0ef50
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
f861937
i am девопсер
DmitriyKomarovCoder Nov 12, 2023
5d702e2
add comment
DmitriyKomarovCoder Nov 12, 2023
976c980
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
716f776
add
DmitriyKomarovCoder Nov 12, 2023
a47d25d
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
3ba008a
ff
DmitriyKomarovCoder Nov 12, 2023
4dad78a
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
bbd1e09
test
DmitriyKomarovCoder Nov 12, 2023
a84a3f7
cd
CodeMaster482 Nov 12, 2023
bd9c94c
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 12, 2023
8e9b8f9
cd
CodeMaster482 Nov 12, 2023
7965bb8
add trigger account, transaction from user
DmitriyKomarovCoder Nov 12, 2023
9de3128
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
54fdcfc
query hotfix
CodeMaster482 Nov 12, 2023
9a70545
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 12, 2023
ea9fe9c
edit docker-compose.yml
DmitriyKomarovCoder Nov 12, 2023
db5b5ac
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 12, 2023
91b137f
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
DmitriyKomarovCoder Nov 12, 2023
25dc99c
edit time csrf
DmitriyKomarovCoder Nov 12, 2023
8785d0f
edit logs
DmitriyKomarovCoder Nov 12, 2023
4795791
edit logs
DmitriyKomarovCoder Nov 12, 2023
c23efc7
edit logs
DmitriyKomarovCoder Nov 12, 2023
94c96e3
edit logs
DmitriyKomarovCoder Nov 12, 2023
916810a
edit logs
DmitriyKomarovCoder Nov 12, 2023
915431f
edit logs
DmitriyKomarovCoder Nov 12, 2023
7b7a521
fd
DmitriyKomarovCoder Nov 12, 2023
2cbe739
fd
DmitriyKomarovCoder Nov 12, 2023
bc409ca
deploy
DmitriyKomarovCoder Nov 12, 2023
10358a5
tag err
CodeMaster482 Nov 12, 2023
8ed984f
tag err hotfix
CodeMaster482 Nov 12, 2023
fd97747
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 12, 2023
6b4188c
tag test down
CodeMaster482 Nov 12, 2023
de5b3d3
cd
CodeMaster482 Nov 12, 2023
ca23b30
cd
CodeMaster482 Nov 12, 2023
eb8c748
edit loggin
DmitriyKomarovCoder Nov 12, 2023
f0fdee7
edit loggin
DmitriyKomarovCoder Nov 12, 2023
758c8a5
edit loggin
DmitriyKomarovCoder Nov 12, 2023
a281bfb
edit loggin
DmitriyKomarovCoder Nov 12, 2023
c4db0b7
edit loggin
DmitriyKomarovCoder Nov 12, 2023
16dc6a3
tags hot fix
CodeMaster482 Nov 12, 2023
e50cec8
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 12, 2023
8d2c242
tags kostily fix
CodeMaster482 Nov 13, 2023
ab5abd2
tags hotfix -test
CodeMaster482 Nov 13, 2023
215544c
deploy
DmitriyKomarovCoder Nov 13, 2023
8c2a709
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
DmitriyKomarovCoder Nov 13, 2023
ed25963
norm
DmitriyKomarovCoder Nov 13, 2023
614a89f
add norm
DmitriyKomarovCoder Nov 13, 2023
3e85f12
?
DmitriyKomarovCoder Nov 13, 2023
626dfa5
?
DmitriyKomarovCoder Nov 13, 2023
8b0ba7c
ura
DmitriyKomarovCoder Nov 13, 2023
a23e637
transaction hotfix add null categories
CodeMaster482 Nov 13, 2023
50d3b91
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 13, 2023
b8e9319
add metric
DmitriyKomarovCoder Nov 19, 2023
ebcd8ec
deploy
DmitriyKomarovCoder Nov 19, 2023
ccd8626
deploy
DmitriyKomarovCoder Nov 19, 2023
90a5dbe
deploy
DmitriyKomarovCoder Nov 19, 2023
d48396d
deploy
DmitriyKomarovCoder Nov 19, 2023
1ae9bd8
deploy
DmitriyKomarovCoder Nov 19, 2023
2369e35
deploy
DmitriyKomarovCoder Nov 19, 2023
3a47ba7
deploy
DmitriyKomarovCoder Nov 19, 2023
7f34ad6
deploy
DmitriyKomarovCoder Nov 19, 2023
3cb2924
deploy
DmitriyKomarovCoder Nov 19, 2023
7da6110
deploy
DmitriyKomarovCoder Nov 19, 2023
d518837
change prometheus
DmitriyKomarovCoder Nov 19, 2023
da8ded2
edit prometheus
DmitriyKomarovCoder Nov 20, 2023
9c6d3b1
deploy
DmitriyKomarovCoder Nov 21, 2023
6b31f2b
deploy
DmitriyKomarovCoder Nov 21, 2023
2eabafc
add search
DmitriyKomarovCoder Nov 21, 2023
85f1d8e
edit time test
DmitriyKomarovCoder Nov 21, 2023
0ee98e7
finally search
DmitriyKomarovCoder Nov 22, 2023
ea13592
update swagger
DmitriyKomarovCoder Nov 22, 2023
4b7a325
deploy
DmitriyKomarovCoder Nov 22, 2023
0789e1f
edit test
DmitriyKomarovCoder Nov 22, 2023
aac1cbb
deploy
DmitriyKomarovCoder Nov 22, 2023
9b20c21
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 22, 2023
8cd5ba6
stage
CodeMaster482 Nov 22, 2023
4ebcbf9
lol
CodeMaster482 Nov 22, 2023
25460e6
init
DmitriyKomarovCoder Nov 22, 2023
baaeffb
add account 2 parameters /(-_-)\
DmitriyKomarovCoder Nov 23, 2023
ef3494c
finally not test commit account
DmitriyKomarovCoder Nov 23, 2023
78af4c1
account finally
DmitriyKomarovCoder Nov 24, 2023
b434b9a
account test
DmitriyKomarovCoder Nov 24, 2023
63f3ba4
account swagger added
DmitriyKomarovCoder Nov 24, 2023
e8f1fa2
add test
DmitriyKomarovCoder Nov 24, 2023
336cc47
edit models
DmitriyKomarovCoder Nov 24, 2023
e6371d7
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 24, 2023
d6cf923
init
DmitriyKomarovCoder Nov 25, 2023
5d2f59f
нуждаюсь в grpc mock
DmitriyKomarovCoder Nov 25, 2023
8459a84
grpc heh
CodeMaster482 Nov 25, 2023
3eec182
grpc hah
CodeMaster482 Nov 25, 2023
99ec00c
merge
CodeMaster482 Nov 25, 2023
d4cde22
merge 2
CodeMaster482 Nov 25, 2023
2c8dd0e
g
CodeMaster482 Nov 25, 2023
7cf37bf
grpc ready
CodeMaster482 Nov 25, 2023
442caa4
aaa
DmitriyKomarovCoder Nov 25, 2023
2a4344b
lol
CodeMaster482 Nov 25, 2023
377bc01
ll
CodeMaster482 Nov 25, 2023
3f16ae0
aaaa
DmitriyKomarovCoder Nov 25, 2023
cd0d418
stage
CodeMaster482 Nov 25, 2023
74c8b87
stage
CodeMaster482 Nov 25, 2023
e37c75c
aaaa
DmitriyKomarovCoder Nov 25, 2023
eb55b28
Merge branch 'questionnaire' of github.com:go-park-mail-ru/2023_2_Ham…
DmitriyKomarovCoder Nov 25, 2023
3125853
aaaaa
DmitriyKomarovCoder Nov 25, 2023
655220e
to dima
CodeMaster482 Nov 25, 2023
6508598
add middleware metrics
DmitriyKomarovCoder Nov 26, 2023
06a3b64
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 26, 2023
72928fa
delete legacy code
DmitriyKomarovCoder Nov 26, 2023
971b72a
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 26, 2023
d26c480
init
DmitriyKomarovCoder Nov 27, 2023
9151475
init
DmitriyKomarovCoder Nov 27, 2023
e6e0c65
init
DmitriyKomarovCoder Nov 27, 2023
96d8040
init
DmitriyKomarovCoder Nov 27, 2023
d851e10
edit proto struct
DmitriyKomarovCoder Nov 27, 2023
6c5ab25
edit account
DmitriyKomarovCoder Nov 27, 2023
4a2da77
add microservice(big) account
DmitriyKomarovCoder Nov 27, 2023
6be0e97
dima fse isporti
CodeMaster482 Nov 27, 2023
5c4219c
add
DmitriyKomarovCoder Nov 28, 2023
f11a312
fix little problem
DmitriyKomarovCoder Nov 28, 2023
e978eeb
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 28, 2023
05430fe
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
DmitriyKomarovCoder Nov 28, 2023
8a68c66
edit defer error
DmitriyKomarovCoder Nov 28, 2023
8ab8067
edit defer error
DmitriyKomarovCoder Nov 28, 2023
85da7d6
edit test
DmitriyKomarovCoder Nov 28, 2023
1fa429c
add test
DmitriyKomarovCoder Nov 28, 2023
bcacae1
add logger
DmitriyKomarovCoder Nov 28, 2023
1558369
fix
DmitriyKomarovCoder Nov 28, 2023
13a1f72
category microservice
DmitriyKomarovCoder Nov 28, 2023
6fbafc2
edit docker-compose
DmitriyKomarovCoder Nov 29, 2023
b69906c
stage
CodeMaster482 Nov 29, 2023
2b6bb6d
merge
CodeMaster482 Nov 29, 2023
23b06b8
microservice run fine
CodeMaster482 Nov 29, 2023
5723a4c
super filter done
DmitriyKomarovCoder Nov 29, 2023
e48b05a
Merge branch 'microservices' of github.com:go-park-mail-ru/2023_2_Ham…
DmitriyKomarovCoder Nov 29, 2023
f1893ae
super filter done
DmitriyKomarovCoder Nov 29, 2023
ad1dd96
finally ci/cd super
DmitriyKomarovCoder Nov 29, 2023
2f9fc5b
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 29, 2023
3ea3d60
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 29, 2023
7c47d67
// */*/
DmitriyKomarovCoder Nov 29, 2023
be180d7
add swagger, good test
DmitriyKomarovCoder Nov 29, 2023
53b83af
tag tests
CodeMaster482 Nov 29, 2023
c93e9d4
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
CodeMaster482 Nov 29, 2023
c27cdd8
add test handler
DmitriyKomarovCoder Nov 29, 2023
c77842a
Merge branch 'develop' of github.com:go-park-mail-ru/2023_2_Hamster i…
DmitriyKomarovCoder Nov 29, 2023
1bd0979
test auth
CodeMaster482 Nov 29, 2023
8f93020
lol 57
CodeMaster482 Nov 29, 2023
093ce8d
hot fix docker
CodeMaster482 Nov 29, 2023
3375ad6
deckerfile fix
CodeMaster482 Nov 29, 2023
ea536fc
try 1
CodeMaster482 Nov 29, 2023
66946f1
try 2
CodeMaster482 Nov 29, 2023
4091b8b
testim
DmitriyKomarovCoder Nov 29, 2023
a65bae5
try3
CodeMaster482 Nov 29, 2023
a73b011
try4
CodeMaster482 Nov 29, 2023
a956690
try5
CodeMaster482 Nov 29, 2023
e7485fa
try6
CodeMaster482 Nov 29, 2023
d59a757
finally
DmitriyKomarovCoder Nov 29, 2023
8173f16
no main
CodeMaster482 Nov 29, 2023
6f38f00
Merge branch 'deploy' of github.com:go-park-mail-ru/2023_2_Hamster in…
CodeMaster482 Nov 29, 2023
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
12 changes: 11 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ SECRET="vzqqEH6o5so_VGJZoLhrfdrH7Y7kvFe-7N2i3I3w314=п"

DB_CONTAINER_NAME=HammyWallet_DB
DB_NAME=HammyWallets
DB_NAME_QUESTION = HammyWallet_QUESTION
DB_USER=hamster
DB_PASSWORD=2003
DB_HOST=0.0.0.0
DB_HOST=hammy-postgres
DB_SSLMODE=disable
DB_PROD_MAIN=5436
DB_PROD_QUESTION = 8300
DB_PORT=5432

DB_NAME_PROD=HammyWallets
DB_USER_PROD=hamster
DB_PASSWORD_PROD=56748
DB_HOST_PROD=postgres
DB_SSLMODE_PROD=disable
DB_PORT_PROD=5436

SERVER_NAME=HammyWallet_API
SERVER_HOST=127.0.0.1
SERVER_PORT=8080
Expand Down
175 changes: 173 additions & 2 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,184 @@
name: CD

env:
REGISTRY: "codemaster482"
IMAGE_NAME: "hammywallet"
CONTAINER_NAME: "hammywallet-api"
FOLDER_COMPOSE: "production"
AUTH_CONTAINER: "hammywallet-auth"
ACCOUNT_CONTAINER: "hammywallet-account"
CATEGORY_CONTAINER: "hammywallet-category"

on:
push:
branches:
- main
- deploy
pull_request:
branches:
- main
- deploy

jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
cache: false

- name: golangci-lint
uses: golangci/golangci-lint-action@v3

- name: Create test folder
run: |
sudo mkdir /images
sudo chmod -R 777 /images

- name: Test with the Go CLI
run: go test ./...


push_to_dockerhub:
runs-on: ubuntu-latest
needs: lint_and_test

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

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

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

- name: DockerHub login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set env
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | head -c 8)" >> $GITHUB_ENV

- name: Build docker and push to dockerhub of CodeMaster
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.GITHUB_SHA_SHORT }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
file: ./build/Dockerfile
build-args: |
IMAGE_NAME=${{ env.IMAGE_NAME }}
REGISTRY=${{ env.REGISTRY }}
GITHUB_SHA_SHORT=${{ env.GITHUB_SHA_SHORT }}

- name: Build and push auth
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.AUTH_CONTAINER }}:${{ env.GITHUB_SHA_SHORT }}, ${{ env.REGISTRY }}/${{ env.AUTH_CONTAINER }}:latest
file: ./build/auth.Dockerfile
build-args: |
IMAGE_NAME=${{ env.AUTH_CONTAINER }}-web
REGISTRY=${{ env.REGISTRY }}
GITHUB_SHA_SHORT=${{ env.GITHUB_SHA_SHORT }}

- name: Build and push account
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.ACCOUNT_CONTAINER }}:${{ env.GITHUB_SHA_SHORT }}, ${{ env.REGISTRY }}/${{ env.ACCOUNT_CONTAINER }}:latest
file: ./build/account.Dockerfile
build-args: |
IMAGE_NAME=${{ env.ACCOUNT_CONTAINER }}
REGISTRY=${{ env.REGISTRY }}
GITHUB_SHA_SHORT=${{ env.GITHUB_SHA_SHORT }}

- name: Build and push category
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.CATEGORY_CONTAINER }}:${{ env.GITHUB_SHA_SHORT }}, ${{ env.REGISTRY }}/${{ env.CATEGORY_CONTAINER }}:latest
file: ./build/category.Dockerfile
build-args: |
IMAGE_NAME=${{ env.CATEGORY_CONTAINER }}
REGISTRY=${{ env.REGISTRY }}
GITHUB_SHA_SHORT=${{ env.GITHUB_SHA_SHORT }}



remote_deploy:
runs-on: ubuntu-latest
needs: push_to_dockerhub

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

- name: Deploy docker-compose via SSH action
uses: appleboy/scp-action@master
with:
debug: true
host: ${{ secrets.DEPLOY_HOST }}
port: ${{ secrets.DEPLOY_PORT }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.SSHKEY }}
rm: true
source: docker-compose.yml, build/schema/initdb.sql, metrics/prometheus/prometheus.yml, build/account.Dockerfile, build/auth.Dockerfile, build/category.Dockerfile
target: ~/${{ env.FOLDER_COMPOSE }}

- name: Get docker form dockerhub via SSH action
uses: appleboy/[email protected]
with:
debug: true
host: ${{ secrets.DEPLOY_HOST }}
port: ${{ secrets.DEPLOY_PORT }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.SSHKEY }}
envs: REGISTRY, IMAGE_NAME, CONTAINER_NAME, GITHUB_SHA, FOLDER_COMPOSE
script: |
sudo bash
cd $(echo $FOLDER_COMPOSE)

cat <<EOF>.env
DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.POSTGRES_USER }}
DB_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_SSLMODE=disable
SERVER_HOST=0.0.0.0
SERVER_PORT=8080
SECRET=${{ secrets.SECRET }}
IMAGE_NAME=${{ env.IMAGE_NAME }}
AUTH_CONTAINER=${{ env.AUTH_CONTAINER }}
ACCOUNT_CONTAINER=${{ env.ACCOUNT_CONTAINER }}
CATEGORY_CONTAINER=${{ env.CATEGORY_CONTAINER }}
REGISTRY=${{ env.REGISTRY }}
CONTAINER_NAME=${{ env.CONTAINER_NAME }}
REDIS_HOST=${{ secrets.REDIS_HOST }}
REDIS_PORT=${{ secrets.REDIS_PORT }}
EOF

echo "GITHUB_SHA_SHORT=`echo $GITHUB_SHA | head -c8`" >> .env

echo ${{ secrets.DOCKERHUB_TOKEN }} | sudo docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin

sudo docker pull $REGISTRY/$IMAGE_NAME:latest
sudo docker pull $REGISTRY/$AUTH_CONTAINER:latest
sudo docker pull $REGISTRY/$ACCOUNT_CONTAINER:latest
sudo docker pull $REGISTRY/$CATEGORY_CONTAINER:latest

sudo docker system prune -f
sudo docker-compose down
sudo docker-compose up -d
sudo sleep 7
sudo chown ubuntu:ubuntu api-logs
4 changes: 2 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.21.x'

- name: Cache Go modules
uses: actions/cache@v3
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.21.x'

- name: Install dependencies
run: go mod tidy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/RebuildDb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO: When initdb.sql updates rebuid docker on deploy action
136 changes: 0 additions & 136 deletions .github/workflows/config.yaml

This file was deleted.

Loading