From 197c822f117fd25d6028a655b6e3327276146879 Mon Sep 17 00:00:00 2001 From: 117503445 Date: Mon, 11 Sep 2023 22:46:31 +0800 Subject: [PATCH 1/2] build: docker cicd Signed-off-by: 117503445 --- .github/workflows/docker.yaml | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/docker.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000000..d21cb0b3b2 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,63 @@ +name: Docker + +on: + push: + branches: + - master + tags: + - v* + workflow_dispatch: + + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + with: + submodules: "recursive" + + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + # https://github.com/docker/login-action + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # https://github.com/docker/metadata-action + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + 117503445/yesplaymusic + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + type=raw,value=latest + + # https://github.com/docker/build-push-action + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 22a73cc9658e74f579d32f9f4a247aa10123ca04 Mon Sep 17 00:00:00 2001 From: 117503445 Date: Mon, 11 Sep 2023 22:48:15 +0800 Subject: [PATCH 2/2] feat: docker cicd Signed-off-by: 117503445 --- .github/workflows/docker.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d21cb0b3b2..d21808100b 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -2,11 +2,6 @@ name: Docker on: push: - branches: - - master - tags: - - v* - workflow_dispatch: jobs: