From c62659e189993205e3a330eec4c6625d20b4e245 Mon Sep 17 00:00:00 2001 From: boraykasap Date: Sun, 12 May 2024 17:53:30 +0300 Subject: [PATCH 1/4] fix problems --- backend/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 14a044e0..1d6d2c05 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -5,7 +5,7 @@ jwt.signing.key=413F4428472B4B6250655368566D5970337336763979244226452948404D6351 spring.application.name=cuisines spring.datasource.url=jdbc:mysql://localhost:3306/cuisines-test?createDatabaseIfNotExist=true spring.datasource.username=root -spring.datasource.password=adminadmin +spring.datasource.password=aadmin spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true From 6b2f8d80fb930aa4607c8defd78271b877f60d6c Mon Sep 17 00:00:00 2001 From: boraykasap Date: Sun, 12 May 2024 17:53:37 +0300 Subject: [PATCH 2/4] fix problems --- backend/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 1d6d2c05..fcbad258 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -5,7 +5,7 @@ jwt.signing.key=413F4428472B4B6250655368566D5970337336763979244226452948404D6351 spring.application.name=cuisines spring.datasource.url=jdbc:mysql://localhost:3306/cuisines-test?createDatabaseIfNotExist=true spring.datasource.username=root -spring.datasource.password=aadmin +spring.datasource.password=admin spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true From 07862d5636f7036afbe13b71c72a66e44a9c9d03 Mon Sep 17 00:00:00 2001 From: boraykasap Date: Sun, 12 May 2024 17:54:41 +0300 Subject: [PATCH 3/4] add frontend deploy staging --- .github/workflows/frontend.yml | 34 ------------------- .github/workflows/frontend_deploy_staging.yml | 31 +++++++++++++++++ 2 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/frontend.yml create mode 100644 .github/workflows/frontend_deploy_staging.yml diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml deleted file mode 100644 index b57d72a0..00000000 --- a/.github/workflows/frontend.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Front-End CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: frontend - - steps: - - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20' - cache: 'yarn' - - - name: Enable Corepack - run: corepack enable - - - name: Install dependencies - run: yarn install --immutable - - - name: Run formatter - run: yarn format - - - name: Run linter - run: yarn lint - - - name: Run tests - run: yarn test diff --git a/.github/workflows/frontend_deploy_staging.yml b/.github/workflows/frontend_deploy_staging.yml new file mode 100644 index 00000000..2e2b7a31 --- /dev/null +++ b/.github/workflows/frontend_deploy_staging.yml @@ -0,0 +1,31 @@ +name: frontend-staging-workflow + +on: + workflow_run: + workflows: ["Front-End CI"] + types: + - completed + branches: + - staging + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Authorize with doctl + run: echo ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | doctl auth init --context github-actions + + - name: Login to Docker registry + run: doctl registry login --context github-actions + + - name: Build Docker image + run: docker compose -f compose.yml build + + - name: Tag Docker image + run: docker tag bounswe2024group1-web:latest registry.digitalocean.com/semantic-browse/web-staging:latest + + - name: Push Docker image + run: docker push registry.digitalocean.com/semantic-browse/web-staging:latest From 6c68fe989f71761825617b0d39eab545a37be72b Mon Sep 17 00:00:00 2001 From: boraykasap Date: Sun, 12 May 2024 19:41:15 +0300 Subject: [PATCH 4/4] use actions/setup-doctl --- .github/workflows/frontend_deploy_staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/frontend_deploy_staging.yml b/.github/workflows/frontend_deploy_staging.yml index 2e2b7a31..cb360837 100644 --- a/.github/workflows/frontend_deploy_staging.yml +++ b/.github/workflows/frontend_deploy_staging.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: digitalocean/action-doctl@v2 - name: Authorize with doctl run: echo ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | doctl auth init --context github-actions