Fix: [CI] Build Docker Image

This commit is contained in:
MengYX 2021-02-08 17:09:26 +08:00
parent 3a5afeb8a6
commit 85fdbff00d
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604
2 changed files with 30 additions and 20 deletions

30
.github/workflows/release-docker.yml vendored Normal file
View File

@ -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 }}

View File

@ -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/ }}