Compare commits
No commits in common. "main" and "release" have entirely different histories.
|
@ -1,18 +1,70 @@
|
||||||
run-name: ${{ gitea.actor }}, deploy to docker registry
|
run-name: ${{ gitea.actor }}, deploy with ssh
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "release"
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_PATH: "."
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Detect package manager
|
||||||
- name: Build and push Docker image
|
id: detect-package-manager
|
||||||
uses: docker/build-push-action@v6
|
run: |
|
||||||
|
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
|
||||||
|
echo "manager=yarn" >> $GITHUB_OUTPUT
|
||||||
|
echo "command=install" >> $GITHUB_OUTPUT
|
||||||
|
echo "runner=yarn" >> $GITHUB_OUTPUT
|
||||||
|
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
elif [ -f "${{ github.workspace }}/package.json" ]; then
|
||||||
|
echo "manager=npm" >> $GITHUB_OUTPUT
|
||||||
|
echo "command=ci" >> $GITHUB_OUTPUT
|
||||||
|
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
|
||||||
|
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Unable to determine package manager"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
node-version: "20"
|
||||||
tags: registry.container-registry:5000/log101-blog:latest
|
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
||||||
|
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
||||||
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
|
- name: Make envfile
|
||||||
|
uses: SpicyPizza/create-envfile@v2.0
|
||||||
|
with:
|
||||||
|
envkey_PUBLIC_BACKEND_HOST: ${{ vars.PUBLIC_BACKEND_HOST }}
|
||||||
|
- name: Build with Astro
|
||||||
|
run: |
|
||||||
|
${{ steps.detect-package-manager.outputs.runner }} astro build
|
||||||
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
|
- name: Deploy to my server
|
||||||
|
id: deploy
|
||||||
|
uses: up9cloud/action-rsync@master
|
||||||
|
env:
|
||||||
|
USER: ${{ secrets.USERNAME }}
|
||||||
|
HOST: ${{ secrets.HOST }}
|
||||||
|
KEY: ${{ secrets.KEY }}
|
||||||
|
SOURCE: ./dist/
|
||||||
|
TARGET: ${{ secrets.DESTINATION_FOLDER }}
|
||||||
|
|
||||||
|
ARGS: -avz --exclude=/.git/
|
||||||
|
SSH_ARGS: "-p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||||
|
VERBOSE: true
|
||||||
|
|
||||||
|
PRE_SCRIPT: |
|
||||||
|
echo start at:
|
||||||
|
date -u
|
||||||
|
POST_SCRIPT: "echo done at: && date -u"
|
||||||
|
|
11
Dockerfile
11
Dockerfile
|
@ -1,11 +0,0 @@
|
||||||
FROM node:lts AS build
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm install
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:alpine AS runtime
|
|
||||||
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
EXPOSE 8080
|
|
|
@ -1,31 +0,0 @@
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
server {
|
|
||||||
listen 8080;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_min_length 1000;
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
error_page 404 /404.html;
|
|
||||||
location = /404.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
internal;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/index.html =404;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
8485
package-lock.json
generated
Normal file
8485
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -11,9 +11,9 @@
|
||||||
"test": "cypress run --browser chrome && cypress run --browser firefox"
|
"test": "cypress run --browser chrome && cypress run --browser firefox"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "0.9.4",
|
"@astrojs/check": "^0.5.10",
|
||||||
"@astrojs/tailwind": "6.0.0",
|
"@astrojs/tailwind": "^5.1.0",
|
||||||
"astro": "5.3.0",
|
"astro": "^4.10.0",
|
||||||
"htmx.org": "^1.9.12",
|
"htmx.org": "^1.9.12",
|
||||||
"remark-toc": "^9.0.0",
|
"remark-toc": "^9.0.0",
|
||||||
"tailwindcss": "^3.4.3",
|
"tailwindcss": "^3.4.3",
|
||||||
|
@ -23,6 +23,5 @@
|
||||||
"cypress": "^13.11.0",
|
"cypress": "^13.11.0",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"prettier-plugin-astro": "^0.14.0"
|
"prettier-plugin-astro": "^0.14.0"
|
||||||
},
|
}
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user