Files
Excalidraw/.github/workflows/docker-build.yml
T
Yuzhong Zhang 88d3983f26 更新项目配置与构建流程
本次提交包含以下主要更改:
1. 更新 `.gitignore` 文件,移除对子目录环境变量文件的忽略。
2. 修改 `excalidraw-complete.Dockerfile`,将构建工具从 `npm` 更改为 `pnpm`,并移除不必要的补丁步骤。
3. 更新 GitHub Actions 工作流 `docker-build.yml`,移除对子模块的递归检出。
4. 修改 `excalidraw/.env.production` 文件,调整后端 API 地址为本地开发环境,并更新 Firebase 配置。
5. 移除 `husky` 相关依赖及配置,简化项目依赖。

这些更改旨在优化开发环境配置,提高构建效率,并简化项目依赖管理。
2025-07-05 23:39:52 +08:00

54 lines
1.5 KiB
YAML

name: Build and Push Docker Image
on:
push:
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: excalidraw-complete
OWNER: betterandbetterii
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./excalidraw-complete.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache,mode=max