ci-10
This commit is contained in:
parent
ea770f4ae8
commit
9a959b4cae
@ -13,8 +13,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io # 直接使用GHCR
|
REGISTRY: ghcr.io # 直接使用GHCR
|
||||||
IMAGE_NAME: test # 对应您要推送的镜像名称
|
IMAGE_NAME: catface_backend_go # 对应您要推送的镜像名称
|
||||||
GHCR_USER: havoc412 # 您的GitHub用户名
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@ -28,7 +27,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Registry: ${{ env.REGISTRY }}"
|
echo "Registry: ${{ env.REGISTRY }}"
|
||||||
echo "Image: ${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}"
|
echo "Image: ${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}"
|
||||||
echo "GitHub Actor: ${{ gitea.actor }}"
|
echo "Gitea Actor: ${{ gitea.actor }}"
|
||||||
|
|
||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -54,17 +53,17 @@ jobs:
|
|||||||
username: ${{ env.GHCR_USER }}
|
username: ${{ env.GHCR_USER }}
|
||||||
password: ${{ secrets.GHCR_TOKEN }} # 在Gitea仓库设置中添加此secret
|
password: ${{ secrets.GHCR_TOKEN }} # 在Gitea仓库设置中添加此secret
|
||||||
|
|
||||||
# - name: 构建并推送 Docker 镜像
|
- name: 构建并推送 Docker 镜像
|
||||||
# uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
# with:
|
with:
|
||||||
# context: .
|
context: .
|
||||||
# push: true
|
push: true
|
||||||
# tags: |
|
tags: |
|
||||||
# ${{ env.REGISTRY }}/${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}:${{ steps.branch_name.outputs.tag }}
|
${{ env.REGISTRY }}/${{ env.GHCR_USER }}/${{ env.IMAGE_NAME }}:${{ steps.branch_name.outputs.tag }}
|
||||||
# labels: |
|
labels: |
|
||||||
# org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}
|
org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}
|
||||||
# build-args: |
|
build-args: |
|
||||||
# BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
|
|
||||||
# - name: 通过SSH部署到服务器
|
# - name: 通过SSH部署到服务器
|
||||||
# if: ${{ steps.branch_name.outputs.branch == 'main' }} # 仅main分支触发部署
|
# if: ${{ steps.branch_name.outputs.branch == 'main' }} # 仅main分支触发部署
|
||||||
|
Loading…
x
Reference in New Issue
Block a user