This commit is contained in:
암냥 2025-12-11 01:16:37 +09:00
commit e176b1c094
No known key found for this signature in database
17 changed files with 632 additions and 0 deletions

53
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: ci
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set version
run: |
if [[ "${GITHUB_REF}" == refs/heads/main ]]; then
echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/imnyang/yanmang/bot:latest
ghcr.io/imnyang/yanmang/bot:${{ env.RELEASE_VERSION }}
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}