mirror of
https://github.com/NapNeko/NapCat-Docker.git
synced 2025-12-18 22:06:41 +08:00
39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
name: docker-publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish-dockerhub:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Get artifacts
|
|
run: |
|
|
bash get_artifacts.sh ${{ secrets.GITHUB_TOKEN }} $(curl -sSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/NapNeko/NapCatQQ/releases/latest" | jq -r '.tag_name')
|
|
- name: Set up Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
# Fork from https://github.com/koishijs/boilerplate/blob/master/.github/workflows/docker.yml
|
|
- name: Run buildx and push
|
|
env:
|
|
DOCKER_REPO: mlikiowa/napcat-docker
|
|
GITHUB_REPO: NapNeko/NapCatQQ
|
|
run: |
|
|
TAG=$(curl -sSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/NapNeko/NapCatQQ/releases/latest" | jq -r '.tag_name')
|
|
docker buildx build \
|
|
--output "type=image,push=true" \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${DOCKER_REPO}:$TAG \
|
|
--tag ${DOCKER_REPO}:latest \
|
|
--file ./Dockerfile \
|
|
.
|
|
- name: Docker Hub logout
|
|
if: always()
|
|
run: docker logout
|