From a73ba6589670890ee1b0a080e79532f48460975a Mon Sep 17 00:00:00 2001 From: 0xTijan Date: Fri, 28 Jun 2024 11:41:48 +0200 Subject: [PATCH] added workflow --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 1 + src/components/navbar/Navbar.tsx | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..725387b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +on: + push: + branches: + - main +name: Deploy website on push + +jobs: + web-deploy: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Get latest code + uses: actions/checkout@v3 + + - name: Use Node.js 16 + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Build Project + run: | + npm install + npm run build + + - name: Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.GIT_CPANEL_REACT_SERVER }} + username: ${{ secrets.GIT_CPANEL_REACT_USER }} + password: ${{ secrets.GIT_CPANEL_REACT_PWD }} + protocol: ${{ secrets.GIT_CPANEL_REACT_PROTOCOL }} + local-dir: ./build/ \ No newline at end of file diff --git a/package.json b/package.json index a11b0f1..a8e8a53 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "portfolio", "version": "0.1.0", "private": true, + "homepage": "./", "dependencies": { "@chakra-ui/react": "^2.2.1", "@emotion/react": "^11.9.3", diff --git a/src/components/navbar/Navbar.tsx b/src/components/navbar/Navbar.tsx index aaba6a2..df66818 100644 --- a/src/components/navbar/Navbar.tsx +++ b/src/components/navbar/Navbar.tsx @@ -14,7 +14,7 @@ const Navbar = () => { const { language } = useLanguage(); const handleScroll = () => { - if (window.scrollY > window.innerHeight*0.22) { + if (window.scrollY > window.innerHeight*0.4) { setShowNavbar(true); } else { setShowNavbar(false);