Files
pwn-nc/.gitea/workflows/docker.yml
clxhzg d7447b80ed
Some checks failed
Build to Gitea Registry / build-push (push) Has been cancelled
commit
2025-12-01 18:30:06 +08:00

34 lines
971 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build to Gitea Registry
on: [push]
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# 登录到 Gitea 内置仓库
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
# Gitea 使用gitea.registry
registry: ${{ gitea.registry }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
# 设置动态标签Gitea 语法)
- name: Set image tags
id: tags
run: |
SHORT_SHA=$(echo ${GITEA_SHA} | cut -c1-8)
echo "::set-output name=tags::${{ gitea.registry }}/${{ gitea.repository }}:${SHORT_SHA},${{ gitea.registry }}/${{ gitea.repository }}:latest"
# 构建并推送
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.tags.outputs.tags }}