ci: add deploy-front workflow (static) + example docker-push workflow
deploy-userbase-front / build-and-deploy (push) Failing after 11m5s

This commit is contained in:
ab
2026-08-04 21:31:34 +08:00
parent e02dcc23da
commit e8eaee0e77
2 changed files with 73 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
name: example-docker-push
# 示例:演示 act_runner 的 docker.sock 能力(构建并推送镜像到 Nexus docker-hosted)
# 需要仓库 Settings -> Actions Secrets 配置:
# NEXUS_USER = admin
# NEXUS_PASSWORD = <nexus admin password>
# 手动触发(Actions 页面 -> Run workflow),不会自动跑。
on:
workflow_dispatch:
inputs:
tag:
description: 'image tag to push'
required: false
default: 'demo'
jobs:
docker-build-push:
runs-on: ubuntu-latest
# docker:24 自带 docker CLI,复用宿主 docker daemon(act_runner 已挂载 docker.sock)
container:
image: docker:24
steps:
- uses: actions/checkout@v4
- name: Login to Nexus docker registry
run: echo "${{ secrets.NEXUS_PASSWORD }}" | docker login nexus:8083 -u ${{ secrets.NEXUS_USER }}
- name: Build image (front nginx)
run: docker build -t nexus:8083/docker-hosted/userbase-front:${{ inputs.tag }} -f front/docker/Dockerfile front
- name: Push image
run: docker push nexus:8083/docker-hosted/userbase-front:${{ inputs.tag }}