Skip to content

Commit

Permalink
Use astro for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
teners committed Apr 6, 2024
1 parent b1318ea commit 5850458
Show file tree
Hide file tree
Showing 25 changed files with 4,269 additions and 6,140 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
46 changes: 21 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,32 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
node-version: 18
- name: Set up yarn
run: yarn set version berry

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache
version: 8
- uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: yarn install --immutable

- name: Build static
run: yarn build
run: pnpm install --prod
- name: Build
run: pnpm build
- uses: actions/upload-artifact@v4
with:
name: 'dist'
path: 'dist'
retention-days: 1

- name: Publish
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: 'dist'
- name: Deploy
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.idea
.yarn
.yarnrc.yml
dist/
.astro/
dependencies
node_modules/
pnpm-debug.log*
.env*
.DS_Store
12 changes: 12 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import("prettier").Config} */
export default {
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
},
},
],
};
18 changes: 0 additions & 18 deletions Caddyfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# teners.me
# tene.rs

![build](https://github.com/teners/teners.me/workflows/build/badge.svg?branch=master&event=push)
8 changes: 8 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'astro/config';

import tailwind from "@astrojs/tailwind";
import purgecss from 'astro-purgecss';

export default defineConfig({
integrations: [tailwind(), purgecss()],
});
15 changes: 0 additions & 15 deletions docker-compose.yml

This file was deleted.

59 changes: 20 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,26 @@
{
"name": "teners.me",
"version": "1.0.0",
"description": "Personal website",
"main": "src/scripts/index.ts",
"name": "tene.rs",
"type": "module",
"version": "2.0.0",
"scripts": {
"build": "webpack build --mode=production",
"build-dev": "webpack build --mode=development",
"serve-dev": "webpack serve --mode=development",
"size": "yarn build && size-limit"
},
"size-limit": [
{
"path": "dist/",
"brotli": true,
"limit": "5 kB",
"webpack": false
}
],
"author": "Sergey Sokolov <[email protected]>",
"license": "The Unlicense",
"engines": {
"node": ">=16.5.0 <17"
},
"devDependencies": {
"@size-limit/file": "^6.0.3",
"@size-limit/webpack": "^8.1.0",
"cssnano": "^5.1.14",
"size-limit": "^8.1.0",
"webpack-dev-server": "^4.11.1"
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier -w src"
},
"dependencies": {
"css-loader": "^6.7.3",
"html-loader": "3.1.0",
"html-webpack-plugin": "5.5.0",
"mini-css-extract-plugin": "^2.4.4",
"node-sass": "^8.0.0",
"preload-webpack-plugin": "^2.3.0",
"sass-loader": "^12.1.0",
"style-loader": "^3.3.0",
"webpack": "^5.75.0",
"webpack-cli": "^4.9.1"
"@astrojs/check": "^0.5.10",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.5.13",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3"
},
"packageManager": "[email protected]"
"devDependencies": {
"astro-purgecss": "^4.1.0",
"astro-seo-meta": "^4.1.0",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0"
}
}
Loading

0 comments on commit 5850458

Please sign in to comment.