From 557665d7924ecf6a27862141e8f31053a38c2948 Mon Sep 17 00:00:00 2001 From: KevinX8 Date: Mon, 19 Apr 2021 15:30:56 +0100 Subject: [PATCH 1/4] attempt to add redirects to react app itself --- src/App.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/App.js b/src/App.js index e99c1e3..a47fa18 100644 --- a/src/App.js +++ b/src/App.js @@ -33,6 +33,21 @@ const App = () => { const childRef = useRef(); let location = useLocation(); + + { + window.location.href = 'https://discord.gg/K9KKDqd'; + return null; + }}/> + { + window.location.href = 'https://adguard.com/?aid=31141'; + return null; + }}/> + { + window.location.href = 'https://brave.com/cge651'; + return null; + }}/> + + useEffect(() => { // const page = location.pathname; document.body.classList.add("is-loaded"); From e88bfa429af551707ef12f602966910b36e3149b Mon Sep 17 00:00:00 2001 From: KevinX8 Date: Mon, 19 Apr 2021 15:36:00 +0100 Subject: [PATCH 2/4] add route --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index a47fa18..6ff2166 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import React, { useRef, useEffect, useState, createContext } from "react"; -import { useLocation, Switch } from "react-router-dom"; +import { useLocation, Switch, Route } from "react-router-dom"; import AppRoute from "./utils/AppRoute"; import ScrollReveal from "./utils/ScrollReveal"; From 7c3b1b568d0ad701fc8f78c2f6875870b3f49693 Mon Sep 17 00:00:00 2001 From: KevinX8 Date: Mon, 19 Apr 2021 15:45:23 +0100 Subject: [PATCH 3/4] fix redirect (maybe?) --- src/App.js | 17 +---------------- src/index.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/App.js b/src/App.js index 6ff2166..e99c1e3 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import React, { useRef, useEffect, useState, createContext } from "react"; -import { useLocation, Switch, Route } from "react-router-dom"; +import { useLocation, Switch } from "react-router-dom"; import AppRoute from "./utils/AppRoute"; import ScrollReveal from "./utils/ScrollReveal"; @@ -33,21 +33,6 @@ const App = () => { const childRef = useRef(); let location = useLocation(); - - { - window.location.href = 'https://discord.gg/K9KKDqd'; - return null; - }}/> - { - window.location.href = 'https://adguard.com/?aid=31141'; - return null; - }}/> - { - window.location.href = 'https://brave.com/cge651'; - return null; - }}/> - - useEffect(() => { // const page = location.pathname; document.body.classList.add("is-loaded"); diff --git a/src/index.js b/src/index.js index 82081fd..e1e7a42 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { Router } from "react-router-dom"; +import { Router, Route } from "react-router-dom"; import { createBrowserHistory } from "history"; import App from './App'; @@ -13,6 +13,18 @@ const history = createBrowserHistory(); ReactDOM.render( + { + window.location.href = 'https://discord.gg/K9KKDqd'; + return null; + }}/> + { + window.location.href = 'https://adguard.com/?aid=31141'; + return null; + }}/> + { + window.location.href = 'https://brave.com/cge651'; + return null; + }}/> , document.getElementById('root') From a8681c09cd9df015d84f77514ed396371a68ee9f Mon Sep 17 00:00:00 2001 From: KevinX8 Date: Mon, 19 Apr 2021 16:12:33 +0100 Subject: [PATCH 4/4] switch to CF pages fully --- .github/workflows/dev-ci.yml | 45 ----------------------------------- .github/workflows/prod-ci.yml | 45 ----------------------------------- 2 files changed, 90 deletions(-) delete mode 100644 .github/workflows/dev-ci.yml delete mode 100644 .github/workflows/prod-ci.yml diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml deleted file mode 100644 index be87869..0000000 --- a/.github/workflows/dev-ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Docker Dev CI - -on: - push: - branches: - - dev - -env: - RELEASE_VERSION: ${{ github.run_number }} - COMMIT_HASH: ${{ github.sha }} - -jobs: - build_and_push: - name: Build dev image and push to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: vanced/website-v2:dev-${{ env.RELEASE_VERSION }},vanced/website-v2:dev-latest - build-args: | - REACT_APP_VANCED_LATEST_API_URL=${{ secrets.REACT_APP_VANCED_LATEST_API_URL_DEV }} - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - - name: Pull and update a new version - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USERNAME }} - key: ${{ secrets.SERVER_KEY }} - port: ${{ secrets.SERVER_PORT }} - script: | - docker pull vanced/website-v2:dev-${{ env.RELEASE_VERSION }} - docker service update --env-add VERSION='${{ env.RELEASE_VERSION }}' --env-add COMMIT='${{ env.COMMIT_HASH }}' --image vanced/website-v2:dev-'${{ env.RELEASE_VERSION }}' dev-website-v2_backend diff --git a/.github/workflows/prod-ci.yml b/.github/workflows/prod-ci.yml deleted file mode 100644 index c3fc0bf..0000000 --- a/.github/workflows/prod-ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Docker Master CI - -on: - push: - branches: - - master - -env: - RELEASE_VERSION: ${{ github.run_number }} - COMMIT_HASH: ${{ github.sha }} - -jobs: - build_and_push: - name: Build master image and push to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - push: true - tags: vanced/website-v2:${{ env.RELEASE_VERSION }},vanced/website-v2:latest - build-args: | - REACT_APP_VANCED_LATEST_API_URL=${{ secrets.REACT_APP_VANCED_LATEST_API_URL }} - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - - name: Pull and update a new version - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USERNAME }} - key: ${{ secrets.SERVER_KEY }} - port: ${{ secrets.SERVER_PORT }} - script: | - docker pull vanced/website-v2:${{ env.RELEASE_VERSION }} - docker service update --env-add VERSION='${{ env.RELEASE_VERSION }}' --env-add COMMIT='${{ env.COMMIT_HASH }}' --image vanced/website-v2:'${{ env.RELEASE_VERSION }}' prod-website-v2_backend