diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d090f4..5064f9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,9 +67,7 @@ jobs: with: host: ${{ secrets.SERVER_HOST }} username: ${{ secrets.SERVER_USERNAME }} - password: ${{ secrets.SERVER_PASSWORD }} key: ${{ secrets.SERVER_SSH_KEY }} - port: ${{ secrets.SERVER_PORT }} script: | docker-compose down links docker-compose pull diff --git a/actions/getSpotifyInfo.ts b/actions/getSpotifyInfo.ts deleted file mode 100644 index 920a7ad..0000000 --- a/actions/getSpotifyInfo.ts +++ /dev/null @@ -1,81 +0,0 @@ -"use server"; - -import { env } from "@/env"; -import { spotifyPlaylistId } from "@/data/constants"; - -export interface GetSpotifyInfo { - title: string; - songs: number; - cover: string; - link: string; -} - -const getToken = async (): Promise => { - const data = new URLSearchParams(); - data.append("grant_type", "client_credentials"); - data.append("client_id", env.SPOTIFY_CLIENT_ID); - data.append("client_secret", env.SPOTIFY_CLIENT_SECRET); - - const res = await fetch("https://accounts.spotify.com/api/token", { - method: "POST", - body: data, - headers: { - "Content-Type": "application/x-www-form-urlencoded", - }, - next: { - revalidate: 60, - }, - }); - if (res.status === 200) return (await res.json()).access_token; -}; - -export const getSpotifyInfo = async (): Promise => { - const defaultValue = { - title: "To drive Porsche 992", - songs: 53, - cover: - "https://image-cdn-ak.spotifycdn.com/image/ab67706c0000bebb07b9c8e2c40dcb8fe14174c6", - link: "https://open.spotify.com/playlist/52ujyIugSAiTRwaQFnwKhL", - }; - const token = await getToken(); - if (!token) return defaultValue; - - const playlistRes = await fetch( - `https://api.spotify.com/v1/playlists/${spotifyPlaylistId}?fields=name,images`, - { - method: "GET", - headers: { - Authorization: `Bearer ${token}`, - }, - next: { - revalidate: 60, - }, - } - ); - - const countRes = await fetch( - `https://api.spotify.com/v1/playlists/${spotifyPlaylistId}/tracks?fields=total`, - { - method: "GET", - headers: { - Authorization: `Bearer ${token}`, - }, - next: { - revalidate: 60, - }, - } - ); - - if (playlistRes.status !== 200 || countRes.status !== 200) - return defaultValue; - - const playlistResponse = await playlistRes.json(); - const countResponse = await countRes.json(); - - return { - title: playlistResponse.name, - songs: countResponse.total, - cover: playlistResponse.images[0].url, - link: `https://open.spotify.com/playlist/${spotifyPlaylistId}`, - }; -}; diff --git a/components/resume-card.tsx b/components/resume-card.tsx index 8b23243..075b9c8 100644 --- a/components/resume-card.tsx +++ b/components/resume-card.tsx @@ -1,27 +1,34 @@ import { cn } from "@/lib/utils"; -import { FileTextIcon } from "lucide-react"; import Link from "next/link"; import { buttonVariants } from "./ui/button"; import { Card, CardDescription, CardFooter, CardHeader } from "./ui/card"; +import Image from "next/image"; export const ResumeCard = async () => { return ( - + icon
- Helios CTO
+ Backend at LPII +
2+ years of work
diff --git a/components/spotify-card.tsx b/components/spotify-card.tsx index af84d35..6b9d910 100644 --- a/components/spotify-card.tsx +++ b/components/spotify-card.tsx @@ -1,4 +1,3 @@ -import { GetSpotifyInfo, getSpotifyInfo } from "@/actions/getSpotifyInfo"; import SpotifyLogo from "@/public/logos/spotify.png"; import Image from "next/image"; import Link from "next/link"; @@ -6,8 +5,12 @@ import { Badge } from "./ui/badge"; import { CardDescription } from "./ui/card"; export const SpotifyCard = async () => { - const { title, songs, cover, link } = - (await getSpotifyInfo()) as GetSpotifyInfo; + const { title, songs, cover, link } = { + title: "Industrial", + songs: 94, + cover: "https://image-cdn-ak.spotifycdn.com/image/ab67706c0000d72c357cb666cb5280bf2460b3df", + link: "https://open.spotify.com/playlist/0GaizFIurafzHZtUTcWGVv", + }; return ( { /> ); -}; \ No newline at end of file +}; diff --git a/data/constants.ts b/data/constants.ts deleted file mode 100644 index 37099da..0000000 --- a/data/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const spotifyPlaylistId = "0GaizFIurafzHZtUTcWGVv"; diff --git a/package.json b/package.json index a02df03..d0c6d8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "links", - "version": "0.4.8", + "version": "0.4.10", "private": true, "scripts": { "dev": "next dev", @@ -19,6 +19,7 @@ "mongoose": "^8.2.0", "next": "14.2.6", "next-themes": "^0.3.0", + "nextjs-google-analytics": "^2.3.7", "react": "18.3", "react-dom": "18.3", "sharp": "^0.33.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e270ac..192772e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: next-themes: specifier: ^0.3.0 version: 0.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + nextjs-google-analytics: + specifier: ^2.3.7 + version: 2.3.7(next@14.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) react: specifier: '18.3' version: 18.3.1 @@ -1601,6 +1604,12 @@ packages: sass: optional: true + nextjs-google-analytics@2.3.7: + resolution: {integrity: sha512-kuE5OcqmAg1qh9J6LskoDLybj8WmLyfxD+KsVGGvRe5zZg6bGQ/QM/1/7TdJq/u7hIeVqFqcloadD0pcosRXUw==} + peerDependencies: + next: '>=11.0.0' + react: '>=17.0.0' + node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -3744,6 +3753,13 @@ snapshots: - '@babel/core' - babel-plugin-macros + nextjs-google-analytics@2.3.7(next@14.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): + dependencies: + next: 14.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 + optionalDependencies: + fsevents: 2.3.3 + node-releases@2.0.14: {} normalize-path@3.0.0: {} diff --git a/public/logos/hh.png b/public/logos/hh.png new file mode 100644 index 0000000..efa3d0d Binary files /dev/null and b/public/logos/hh.png differ