feat: update logging config #104
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
name: Build and deploy flow | |
on: [push] | |
env: | |
ENVIRONMENT_PATH: /tmp/${{github.event.repository.name}}.env | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: login to dockerhub | |
uses: docker/login-action@21f251affc0769ccac8a1cf17e937592fb492337 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_ACCESS_TOKEN}} | |
- name: build and push | |
uses: docker/build-push-action@e27bcee4eb9e7b4bc168418e3364c4482120393a | |
with: | |
push: true | |
tags: ${{secrets.DOCKERHUB_USERNAME}}/${{github.event.repository.name}}:latest | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: deploy | |
run: | | |
eval `ssh-agent -s` | |
mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
ssh-add - <<< "${{secrets.BACKEND_DEPLOY_USER_SSH_KEY}}" | |
ssh ${{secrets.BACKEND_DEPLOY_USER_USERNAME}}@${{secrets.BACKEND_HOST}} "docker login -u ${{secrets.DOCKERHUB_USERNAME}} -p ${{secrets.DOCKERHUB_ACCESS_TOKEN}} && \ | |
docker pull ${{secrets.DOCKERHUB_USERNAME}}/${{github.event.repository.name}}:latest && \ | |
(docker stop ${{github.event.repository.name}} && docker rm ${{github.event.repository.name}} || echo "container with name $CI_PROJECT_NAME not found. nothing to delete") | |
docker run -p 5443:80 \ | |
-e DATABASE__HOST=${{secrets.DATABASE__HOST}} \ | |
-e DATABASE__PORT=${{secrets.DATABASE__PORT}} \ | |
-e DATABASE__USERNAME=${{secrets.DATABASE__USERNAME}} \ | |
-e DATABASE__PASSWORD=${{secrets.DATABASE__PASSWORD}} \ | |
-e DATABASE__NAME=${{secrets.DATABASE__NAME}} \ | |
-e S3__HOST=${{secrets.S3__HOST}} \ | |
-e S3__PORT=${{secrets.S3__PORT}} \ | |
-e S3__ACCKEY=${{secrets.S3__ACCKEY}} \ | |
-e S3__SECKEY=${{secrets.S3__SECKEY}} \ | |
-e S3__ENDPOINT=${{secrets.S3__ENDPOINT}} \ | |
-e S3__BUCKET=${{secrets.S3__BUCKET}} \ | |
-e S3__ENDPOINT=${{secrets.S3__ENDPOINT}} \ | |
-e SENTRY__DSN=${{secrets.SENTRY__DSN}} \ | |
-e API__SECRET_KEY=${{secrets.API__SECRET_KEY}} \ | |
-e USER_AUTH__APPLE_PROVIDER__BUNDLE_ID=${{secrets.USER_AUTH__APPLE_PROVIDER__BUNDLE_ID}} \ | |
-e USER_AUTH__APPLE_PROVIDER__PRIVATE_KEY=${{secrets.USER_AUTH__APPLE_PROVIDER__PRIVATE_KEY}} \ | |
-e USER_AUTH__APPLE_PROVIDER__TEAM_ID=${{secrets.USER_AUTH__APPLE_PROVIDER__TEAM_ID}} \ | |
-e ENVIRONMENT=${{secrets.ENVIRONMENT}} \ | |
-e EMAIL_SERVICE__USERNAME=${{secrets.EMAIL_SERVICE__USERNAME}} \ | |
-e EMAIL_SERVICE__PASSWORD=${{secrets.EMAIL_SERVICE__PASSWORD}} \ | |
-e EMAIL_SERVICE__SMTP_HOST=${{secrets.EMAIL_SERVICE__SMTP_HOST}} \ | |
-e EMAIL_SERVICE__SMTP_PORT=${{secrets.EMAIL_SERVICE__SMTP_PORT}} \ | |
-e RECOVERY_BASE_PATH=${{secrets.RECOVERY_BASE_PATH}} \ | |
--name ${{github.event.repository.name}} --network ${{secrets.BACKEND_DOCKER_NETWORK}} \ | |
--restart always \ | |
-d \ | |
${{secrets.DOCKERHUB_USERNAME}}/${{github.event.repository.name}}:latest" |