-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4314734
commit 1a09b27
Showing
1 changed file
with
10 additions
and
11 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 |
---|---|---|
|
@@ -21,22 +21,17 @@ jobs: | |
|
||
- name: Docker image build and push | ||
uses: docker/build-push-action@v2 | ||
env: | ||
DB_HOST: ${{ secrets.DB_HOST }} | ||
DB_PORT: ${{ secrets.DB_PORT }} | ||
DB_NAME: ${{ secrets.DB_NAME }} | ||
DB_USERNAME: ${{ secrets.DB_USERNAME }} | ||
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/backend:latest | ||
build-args: | | ||
DB_HOST: ${{ secrets.DB_HOST }} | ||
DB_PORT: ${{ secrets.DB_PORT }} | ||
DB_NAME: ${{ secrets.DB_NAME }} | ||
DB_USERNAME: ${{ secrets.DB_USERNAME }} | ||
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | ||
- name: Set environment variables | ||
run: | | ||
echo "MYSQL_DATABASE=${{ secrets.DB_NAME }}" > .env | ||
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> .env | ||
|
||
- name: Deploy Application | ||
uses: appleboy/[email protected] | ||
|
@@ -48,6 +43,10 @@ jobs: | |
echo "### Change directory to Backend ###" | ||
cd /home/***/Backend | ||
echo "### Set environment variables ###" | ||
export MYSQL_DATABASE=${{ secrets.DB_NAME }} | ||
export MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }} | ||
echo "### Pull origin main from github ###" | ||
git pull origin actions | ||
|