From 467b902b956b6498cbc8e5593114bb74917ada34 Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 6 Apr 2023 14:16:08 +0200 Subject: [PATCH 1/4] Proxying API and WS calls --- nginx/default.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/nginx/default.conf b/nginx/default.conf index c7a7bf0..c9c7c57 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -10,6 +10,26 @@ server { try_files $uri $uri/ /index.html =404; } + location /api/ { + proxy_pass http://api:8080/; + proxy_set_header Host api; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # WebSocket proxy configuration + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + # WebSocket endpoint proxy configuration + location /ws/ { + proxy_pass http://websocket-service:8080/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + #error_page 404 /404.html; # redirect server error pages to the static page /50x.html From e0e39e3391976211302e541d5aad183c9bb553d2 Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 6 Apr 2023 14:21:33 +0200 Subject: [PATCH 2/4] Updating to version 6.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25687e2..eb8b616 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "5.5.9", + "version": "6.0.0", "description": "React frontend for the Cards 110", "author": "Daithi Hearn", "license": "MIT", From 63170688c7412887ca41674b8bd72c7c8b1109e7 Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 6 Apr 2023 14:23:05 +0200 Subject: [PATCH 3/4] Updating to version 6.0.0 --- public/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/manifest.json b/public/manifest.json index 9a62a39..e128aaa 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,7 +1,7 @@ { "short_name": "Cards 110", "name": "Cards 110", - "version": "5.5.9", + "version": "6.0.0", "icons": [ { "src": "./assets/favicon.png", From b8414754e2a83d6f9ca7cdbab27338a39fe7c67f Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Thu, 6 Apr 2023 14:24:23 +0200 Subject: [PATCH 4/4] Simplifying build --- .github/workflows/publish-to-dockerhub.yml | 57 ++++++++-------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/publish-to-dockerhub.yml b/.github/workflows/publish-to-dockerhub.yml index f179fe5..4526d19 100644 --- a/.github/workflows/publish-to-dockerhub.yml +++ b/.github/workflows/publish-to-dockerhub.yml @@ -15,21 +15,33 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Update version in package.json - run: yarn version --no-git-tag-version --new-version ${{ github.ref_name }} + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Get version in manifest.json - id: manifestversion + id: manifest-version uses: notiz-dev/github-action-json-property@release with: path: "public/manifest.json" prop_path: "version" - - name: Update manifest.json version - if: ${{ steps.manifestversion.outputs.prop != github.ref_name }} - uses: jossef/action-set-json-field@v2 + - name: Ensure the manifest version matches the tag version + if: ${{ steps.manifest-version.outputs.prop != github.ref_name }} + uses: actions/github-script@v3 + with: + script: | + core.setFailed('The version in the manifest must match the tag.') + - name: Get version in package.json + id: package-version + uses: notiz-dev/github-action-json-property@release + with: + path: "package.json" + prop_path: "version" + - name: Ensure the package.json version matches the tag version + if: ${{ steps.package-version.outputs.prop != github.ref_name }} + uses: actions/github-script@v3 with: - file: public/manifest.json - field: version - value: ${{ github.ref_name }} + script: | + core.setFailed('The version in the package.json must match the tag.') - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -42,30 +54,3 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} platforms: linux/amd64,linux/arm64/v8 tags: "latest, ${{ github.ref_name }}" - - - name: Create PR with version changes - id: cpr - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.PAT_PR }} - commit-message: Update latest version (${{ github.ref_name }}) - title: Update latest version (${{ github.ref_name }}) - body: | - Update latest version (${{ github.ref_name }}) - branch: update-version-${{ github.ref_name }} - delete-branch: true - base: main - add-paths: | - package.json - public/manifest.json - labels: | - update - assignees: | - ${{ github.actor }} - - name: Enable Pull Request Automerge - if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@v2 - with: - token: ${{ secrets.PAT_PR }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash