Files
wxapp-guantong/.gitea/workflows/backend-image.yml
T
rogee 2458218885
Build and push backend image / backend-image (push) Successful in 1m33s
Add backend image publish workflow
2026-09-22 23:49:29 +08:00

44 lines
1.1 KiB
YAML

name: Build and push backend image
on:
push:
branches:
- main
paths:
- backend/**
- .gitea/workflows/backend-image.yml
workflow_dispatch:
jobs:
backend-image:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Log in to Gitea container registry
env:
REGISTRY: git.ipao.vip
REGISTRY_USERNAME: ${{ github.repository_owner }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
test -n "$REGISTRY_TOKEN"
printf '%s' "$REGISTRY_TOKEN" | docker login "$REGISTRY" \
--username "$REGISTRY_USERNAME" \
--password-stdin
- name: Build and push backend image
env:
REGISTRY: git.ipao.vip
IMAGE_NAME: ${{ github.repository }}
IMAGE_TAG: ${{ github.sha }}
run: |
set -eu
image="$REGISTRY/$IMAGE_NAME"
docker build \
--file backend/Dockerfile \
--tag "$image:$IMAGE_TAG" \
backend
docker push "$image:$IMAGE_TAG"