mirror of
https://github.com/snowykami/sfkm.me-next.git
synced 2025-09-04 03:16:44 +00:00
- Added global CSS file with Tailwind CSS imports and custom styles for light and dark themes. - Created layout component to include Google Fonts and set up metadata for the application. - Developed main page layout with responsive design, including navigation and footer links. - Configured TypeScript settings for the project with strict type checking and module resolution.
73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
# 打包容器镜像,推送到私有云镜像站,并在目标主机上部署
|
|
# 需要的密钥变量
|
|
# DOCKER_HOST
|
|
# DOCKER_TLS_CA
|
|
# DOCKER_TLS_CERT
|
|
# DOCKER_TLS_KEY
|
|
# HARBOR_REGISTRY: e.g. dockerhub.com
|
|
# HARBOR_USERNAME: e.g. christina
|
|
# HARBOR_PASSWORD: e.g. 123456
|
|
# Author: s@liteyuki.org
|
|
|
|
name: Build and Push Container Image, Deploy to Host
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: docker-build
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
CONTAINER_TAG: reg.liteyuki.org/snowykami/sfkm-me:latest
|
|
CONTAINER_NAME: sfkm-me
|
|
CONTAINER_OPTIONS: --network liteyuki-network --network liteyuki6-network
|
|
|
|
jobs:
|
|
build-and-push-and-deploy:
|
|
runs-on: liteyukios-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://git.liteyuki.org/actions/checkout@v4
|
|
|
|
- name: Set up Docker TLS
|
|
run: |
|
|
mkdir -p /certs
|
|
echo "${{ secrets.DOCKER_TLS_CA }}" > /certs/ca.pem
|
|
echo "${{ secrets.DOCKER_TLS_CERT }}" > /certs/cert.pem
|
|
echo "${{ secrets.DOCKER_TLS_KEY }}" > /certs/key.pem
|
|
chmod 600 /certs/key.pem
|
|
echo "Docker TLS setup complete."
|
|
|
|
|
|
- name: Log in to Liteyuki Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ secrets.HARBOR_REGISTRY }}
|
|
username: ${{ secrets.HARBOR_USERNAME }}
|
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
- name: Build and push container image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ env.CONTAINER_TAG }}
|
|
|
|
|
|
- name: Update container image on host
|
|
run: |
|
|
docker pull ${{ env.CONTAINER_TAG }}
|
|
docker stop ${{ env.CONTAINER_NAME }} || true
|
|
docker rm ${{ env.CONTAINER_NAME }} || true
|
|
docker run -d --name ${{ env.CONTAINER_NAME }} ${{ env.CONTAINER_OPTIONS }} ${{ env.CONTAINER_TAG }} |