-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from go-park-mail-ru/dev4
Dev4
- Loading branch information
Showing
68 changed files
with
4,034 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Start pinspire CI | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: {} | ||
pull_request: | ||
types: [opened, edited, reopened] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Test application | ||
continue-on-error: true | ||
run: go test ./... | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Lint application | ||
run: make lint | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Build application | ||
run: make build_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Start Pinspire deployment | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
- dev4 | ||
|
||
jobs: | ||
build_images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get repository code | ||
uses: actions/checkout@v4 | ||
- name: Login to DockerHub Registry | ||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
- name: Build docker images of services | ||
run: | | ||
docker build -t pinspireapp/main:latest -f deployments/Dockerfile.main . & | ||
docker build -t pinspireapp/auth:latest -f deployments/Dockerfile.auth . & | ||
docker build -t pinspireapp/realtime:latest -f deployments/Dockerfile.realtime . & | ||
docker build -t pinspireapp/messenger:latest -f deployments/Dockerfile.messenger . & | ||
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done | ||
- name: Push docker images | ||
run: | | ||
docker push pinspireapp/main:latest & | ||
docker push pinspireapp/auth:latest & | ||
docker push pinspireapp/realtime:latest & | ||
docker push pinspireapp/messenger:latest & | ||
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build_images | ||
steps: | ||
- name: fetch changes | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: pinspire.online | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
script: | | ||
cd ${{ secrets.PINSPIRE_BACKEND_PATH }} | ||
sudo git switch dev4 | ||
sudo git pull | ||
- name: deploy application | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: pinspire.online | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
script: | | ||
cd ${{ secrets.PINSPIRE_BACKEND_PATH }}/deployments | ||
sudo docker compose down main_service auth_service realtime_service messenger_service | ||
sudo docker rmi pinspireapp/main:latest pinspireapp/auth:latest pinspireapp/realtime:latest pinspireapp/messenger:latest | ||
sudo docker compose -f docker-compose.yml -f compose.prod.yml up -d | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,6 @@ testdata/ | |
cert/ | ||
.env | ||
redis.conf | ||
inventory | ||
keyVision.json | ||
script* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.