From 85fdbff00d6b50926ac968d0e20e64111872033e Mon Sep 17 00:00:00 2001 From: MengYX Date: Mon, 8 Feb 2021 17:09:26 +0800 Subject: [PATCH] Fix: [CI] Build Docker Image --- .github/workflows/release-docker.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 20 ------------------- 2 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/release-docker.yml diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml new file mode 100644 index 0000000..d83c35b --- /dev/null +++ b/.github/workflows/release-docker.yml @@ -0,0 +1,30 @@ +name: Publish Docker image +on: + release: + types: [ published ] +jobs: + - name: Download release content + run: | + wget -o modern.tar.gz "https://github.com/ix64/unlock-music/releases/download/${{ GITHUB_REF }}/modern.tar.gz" + mkdir ./dist + tar zxvf modern.tar.gz -C ./dist + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build docker and push (on modern) + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64,linux/386 + push: true + tags: | + ix64/unlock-music:latest + ix64/unlock-music:${{ GITHUB_REF }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30dceae..f5e0f2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -132,23 +132,3 @@ jobs: asset_path: ./sha256sum.txt asset_name: sha256sum.txt asset_content_type: text/plain - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build docker and push (on modern) - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64,linux/386 - push: true - tags: | - ix64/unlock-music:latest - ix64/unlock-music:${{ GITHUB_REF#refs/tags/ }}