2024-11-16 02:19:31 +08:00
|
|
|
|
|
|
|
name: Docker Image Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
concurrency:
|
2024-11-16 02:20:06 +08:00
|
|
|
group: docker-build
|
2024-11-16 02:19:31 +08:00
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
2025-02-18 09:06:52 +08:00
|
|
|
- name: Log in to GitHub Container Registry
|
2024-11-16 02:19:31 +08:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
2025-02-18 09:06:52 +08:00
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ secrets.GHCR_USERNAME }}
|
|
|
|
password: ${{ secrets.GHCR_PASSWORD }}
|
2024-11-16 02:19:31 +08:00
|
|
|
|
|
|
|
- name: Build and push Docker image
|
2025-02-18 09:06:52 +08:00
|
|
|
uses: docker/build-push-action@v6
|
2024-11-16 02:19:31 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
2025-02-18 09:06:52 +08:00
|
|
|
tags: ghcr.io/LiteyukiStudio/LiteyukiBot:latest
|
2024-11-16 02:19:31 +08:00
|
|
|
|
2025-02-18 09:06:52 +08:00
|
|
|
- name: Log out from GitHub Container Registry
|
|
|
|
run: docker logout ghcr.io
|