Update ci.yml

This commit is contained in:
涵曦 2024-10-30 11:07:55 +08:00 committed by GitHub
parent e48c6456fc
commit d7fd7c43dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ on:
env:
TEST_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:${{ github.ref_name }}
jobs:
build-and-test:
build-test-publish:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
strategy:
@ -44,15 +44,20 @@ jobs:
push: false
load: true
tags: ${{ env.TAGNAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Test Docker image
run: docker run --rm ${{ env.TAGNAME }} -h
publish:
- name: Publish to Docker Hub
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
context: .
push: true
tags: ${{ env.TEST_TAG }}
publish-readme:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
@ -60,16 +65,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
context: .
push: true
tags: ${{ env.TEST_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache-new
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with: