From b17abd776ee944a20356e86f2feef8a95cb526f1 Mon Sep 17 00:00:00 2001 From: Thibaut Valentin Date: Sun, 29 Dec 2024 13:13:12 +0100 Subject: [PATCH] update: ci/cd --- .gitea/workflows/deploy_in_prod.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .gitea/workflows/deploy_in_prod.yml diff --git a/.gitea/workflows/deploy_in_prod.yml b/.gitea/workflows/deploy_in_prod.yml new file mode 100644 index 0000000..7367f7c --- /dev/null +++ b/.gitea/workflows/deploy_in_prod.yml @@ -0,0 +1,41 @@ +name: Deploy Production Server + +# Only run the workflow when a PR is merged on main and closed +on: + pull_request: + types: + - closed + branches: + - 'master' + +# Here we check that the PR was correctly merged to main +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'graalvm' + cache: 'maven' + + - name: Build site + run: | + cp vite.env src/main/webapp/.env + cd src/main/webapp + npm install + npm run build + cd ../../.. + rm -rf src/main/resources/META-INF/resources + mkdir -p src/main/resources/META-INF/ + mv dist src/main/resources/META-INF/resources + + - name: Build application + run: | + cp ../vite.env src/main/webapp/.env + chmod 740 mvnw + ./mvnw package -Pnative -DskipTests \ No newline at end of file