add GitHub Actions workflow and Dockerfile for building and pushing container image
Some checks failed
Build and Push Container Image / build-and-push-and-deploy (push) Failing after 1m51s

This commit is contained in:
2025-06-16 00:43:17 +08:00
commit abfbb698f2
6 changed files with 126 additions and 0 deletions

41
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Build and Push Container Image
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: docker-build
cancel-in-progress: false
env:
CONTAINER_TAG: liteyuki/new-domain-redir:latest
REGISTRY: reg.liteyuki.org
jobs:
build-and-push-and-deploy:
runs-on: liteyukios-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Liteyuki Harbor
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.LCR_USERNAME }}
password: ${{ secrets.LCR_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push container image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.CONTAINER_TAG }}