Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
LimiteDiTempo committed Aug 26, 2024
1 parent e6337e1 commit ee917b1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
DATABASE_URL: ${{ secrets.DB_URL }}
DATABASE_USER: ${{ secrets.DB_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DB_PASSWORD }}

steps:
- name: Checkout
Expand All @@ -31,15 +34,6 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Set yml file
uses: microsoft/variable-substitution@v1
with:
files: src/main/resources/application.yaml
env:
spring.datasource.url: ${{ secrets.DB_URL }}
spring.datasource.username: ${{ secrets.DB_USERNAME }}
spring.datasource.password: ${{ secrets.DB_PASSWORD }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -49,7 +43,10 @@ jobs:
- name: Docker build
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
docker build -t ${{ secrets.DOCKER_USERNAME }}/uiseong-come-on .
docker build -t ${{ secrets.DOCKER_USERNAME }}/uiseong-come-on \
--build-arg DATABASE_URL=${{ secrets.DB_URL }} \
--build-arg DATABASE_USER=${{ secrets.DB_USERNAME }} \
--build-arg DATABASE_PASSWORD=${{ secrets.DB_PASSWORD }} .
docker push ${{ secrets.DOCKER_USERNAME }}/uiseong-come-on:latest
- name: Install azd
Expand All @@ -58,10 +55,11 @@ jobs:
- name: Log in with Azure (Federated Credentials)
if: ${{ env.AZURE_CLIENT_ID != '' }}
run: |
azd auth login \
--client-id "${{ env.AZURE_CLIENT_ID }}" \
--federated-credential-provider "github" \
--tenant-id "${{ env.AZURE_TENANT_ID }}"
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
shell: pwsh

- name: Log in with Azure (Client Credentials)
if: ${{ env.AZURE_CREDENTIALS != '' }}
Expand Down
5 changes: 1 addition & 4 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM openjdk:latest

ARG DATABASE_URL
ARG DATABASE_USER
ARG DATABASE_PASSWORD

ENV DATABASE_URL=$DATABASE_URL
ENV DATABASE_USERNAME=$DATABASE_USER
ENV DATABASE_PASSWORD=$DATABASE_PASSWORD

COPY ../build/libs/chapterTwo-0.0.1-SNAPSHOT.jar /app/app.jar

ENTRYPOINT ["java", "-jar", "/app/app.jar"]

0 comments on commit ee917b1

Please sign in to comment.