Add Gitea CI to build and push images to docker.sejong.dev.
Switch compose to pull sejong-office:latest and document registry secrets and deploy steps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5211b0d7ef
commit
816bf636de
3 files changed
+154
-2
No files matched your search
@@ -0,0 +1,61 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Type-check & Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Type-check and build
|
||||
run: npm run build
|
||||
|
||||
image:
|
||||
name: Build & Push image
|
||||
needs: build
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: docker.sejong.dev
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
docker.sejong.dev/sejong-office:latest
|
||||
docker.sejong.dev/sejong-office:sha-${{ github.sha }}
|
||||
|
||||
- name: Log out of registry
|
||||
if: always()
|
||||
run: docker logout docker.sejong.dev
|
||||
Reference in new issue
Block a user