From a674b41d00f3176c4b6d3be90ac76fed630dd58a Mon Sep 17 00:00:00 2001 From: Firq Date: Mon, 6 Mar 2023 19:12:59 +0100 Subject: [PATCH] Bye gitlab pages, welcome cd/ci with server --- .gitlab-ci.yml | 26 +++++++++++++------------- .old.gitlab-ci.yml | 14 ++++++++++++++ astro.config.mjs | 4 ++-- package.json | 2 +- src/components/ceCard.astro | 4 ++-- src/components/favouriteCard.astro | 2 +- src/components/navbar.astro | 4 ++-- src/components/navbarEntry.astro | 2 +- src/components/servantCard.astro | 4 ++-- src/components/taCard.astro | 2 +- src/components/technologyCard.astro | 2 +- src/layouts/Layout.astro | 6 +++--- src/layouts/customFooter.astro | 4 ++-- 13 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 .old.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74095ea..5d368d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,14 @@ -image: node:lts -pages: - cache: - paths: - - node_modules/ +deploy-site: + stage: deploy + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: - - npm install - - npm run build - artifacts: - paths: - - public - expire_in: 3 days - only: - - main + - echo "Connecting to proxmox machine" + - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S website-firq-npx kill; rm -r -f public/*; cd build; git pull; rm -r -f node_modules; npm install; npm run build; cp -R public ~; cd ~; screen -S website-firq-npx -dm npx serve public/ -p 9000" \ No newline at end of file diff --git a/.old.gitlab-ci.yml b/.old.gitlab-ci.yml new file mode 100644 index 0000000..74095ea --- /dev/null +++ b/.old.gitlab-ci.yml @@ -0,0 +1,14 @@ +image: node:lts +pages: + cache: + paths: + - node_modules/ + script: + - npm install + - npm run build + artifacts: + paths: + - public + expire_in: 3 days + only: + - main diff --git a/astro.config.mjs b/astro.config.mjs index ba01c05..bb6d99e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,8 +3,8 @@ import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ sitemap: true, - base: '/fgosite', + base: '/', outDir: 'public', publicDir: 'static', - site: 'https://firq.pages.neshweb.net/fgosite/' + site: 'https://firq.dev/' }); diff --git a/package.json b/package.json index 388a1c3..728073d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@firq/fgosite", "type": "module", - "version": "0.0.1", + "version": "0.1.1", "private": true, "scripts": { "dev": "astro dev", diff --git a/src/components/ceCard.astro b/src/components/ceCard.astro index b7b255f..167ba19 100644 --- a/src/components/ceCard.astro +++ b/src/components/ceCard.astro @@ -7,8 +7,8 @@ export interface Props { const {mlb, link, name } = Astro.props; -const ce_img: string = `/fgosite/ce/${link}.webp`; -const mlb_ce: string = `/fgosite/ce/mlb.webp` +const ce_img: string = `/ce/${link}.webp`; +const mlb_ce: string = `/ce/mlb.webp` let mlb_image: string = "mlbalign"; if(mlb === "false") { diff --git a/src/components/favouriteCard.astro b/src/components/favouriteCard.astro index 78baafa..d383f06 100644 --- a/src/components/favouriteCard.astro +++ b/src/components/favouriteCard.astro @@ -7,7 +7,7 @@ export interface Props { const {image, origin, name } = Astro.props; -const img: string = `/fgosite/favourites/${image}.webp`; +const img: string = `/favourites/${image}.webp`; --- diff --git a/src/components/navbar.astro b/src/components/navbar.astro index 0e740c0..c1a923b 100644 --- a/src/components/navbar.astro +++ b/src/components/navbar.astro @@ -2,8 +2,8 @@ ---
- - + +