From 55b89818bccbe1b0e83fe4908bfd2b114e68cf05 Mon Sep 17 00:00:00 2001 From: Andrew Parker Date: Wed, 7 Aug 2024 20:37:16 -0400 Subject: [PATCH] attempt to introduce fe deployment --- .../workflows/genparker-build-and-deploy.yml | 17 ++++++++++++++--- apps/releaf/qr-code/Dockerfile | 9 +++++++++ apps/releaf/qr-code/nginx.conf | 9 +++++++++ apps/releaf/qr-code/project.json | 14 +++++++++++++- nx.json | 5 ++++- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 apps/releaf/qr-code/Dockerfile create mode 100644 apps/releaf/qr-code/nginx.conf diff --git a/.github/workflows/genparker-build-and-deploy.yml b/.github/workflows/genparker-build-and-deploy.yml index 72c3b1d..8b8b060 100644 --- a/.github/workflows/genparker-build-and-deploy.yml +++ b/.github/workflows/genparker-build-and-deploy.yml @@ -25,6 +25,17 @@ jobs: echo "::set-output name=environment::production" echo "::set-output name=branch::main" + prepare-fe: + runs-on: ubuntu-latest + needs: init + steps: + - uses: BesLogic/releaf-genparker@v0.0.5 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: publish affected + run: npx nx affected --target=publish-fe --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment }} --parallel=5 + prepare-be: runs-on: ubuntu-latest needs: init @@ -58,7 +69,7 @@ jobs: git commit -am "Updating the project's structure" git push -f origin main:deployment/philantropy - + prepare-mobile: runs-on: ubuntu-latest needs: init @@ -85,10 +96,10 @@ jobs: - name: get file run: | curl -o ./apps/releaf/mobile/android/app/releaf.keystore -H "Authorization: token ${RELEAF_GENPARKER_KEYS}" https://raw.githubusercontent.com/andy2great/releaf-genparker-keys/main/releaf.keystore - + - name: publish affected run: npx nx affected --target=build-mobile --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment}} --parallel=5 - + - uses: r0adkll/upload-google-play@v1 if: ${{ hashFiles('apps/releaf/mobile/android/app/build/outputs/bundle/release/app-release.aab') != '' }} with: diff --git a/apps/releaf/qr-code/Dockerfile b/apps/releaf/qr-code/Dockerfile new file mode 100644 index 0000000..50fd67b --- /dev/null +++ b/apps/releaf/qr-code/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx:1.15 + +WORKDIR /interface +COPY ./ /interface/ + +RUN rm /etc/nginx/conf.d/* +COPY ./apps/releaf/qr-code/website.conf /etc/nginx/conf.d/website.conf + +COPY --from=build-stage /interface/dist/apps/qr-code/ /usr/share/nginx/html diff --git a/apps/releaf/qr-code/nginx.conf b/apps/releaf/qr-code/nginx.conf new file mode 100644 index 0000000..f2cb554 --- /dev/null +++ b/apps/releaf/qr-code/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80 default_server; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } +} \ No newline at end of file diff --git a/apps/releaf/qr-code/project.json b/apps/releaf/qr-code/project.json index be33cc5..fee53f1 100644 --- a/apps/releaf/qr-code/project.json +++ b/apps/releaf/qr-code/project.json @@ -4,5 +4,17 @@ "projectType": "application", "sourceRoot": "apps/releaf/qr-code/src", "// targets": "to see all targets run: nx show project qr-code --web", - "targets": {} + "targets": { + "publish-fe": { + "executor": "@nx-tools/nx-container:build", + "options": { + "push": true + }, + "configurations": { + "production": { + "tags": ["ghcr.io/beslogic/releaf_qr_code:latest"] + } + } + } + } } diff --git a/nx.json b/nx.json index adbd942..88aaff7 100644 --- a/nx.json +++ b/nx.json @@ -19,8 +19,11 @@ "publish": { "dependsOn": ["setup", "build"] }, + "publish-fe": { + "dependsOn": ["setup", "build"] + }, "setup": { - "dependsOn": ["build", "build-android", "bleh"] + "dependsOn": ["build", "build-android"] }, "build": { "dependsOn": ["^build", "codegen", "^codegen"],