Skip to content

Commit

Permalink
ci: 添加多平台构建;部署修改为 ghcr.io 源
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Jun 6, 2024
1 parent 31d6b40 commit 7002906
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
build:
needs: test # 等待 test 执行成功
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 30
permissions:
packages: write
contents: read
Expand All @@ -58,6 +58,10 @@ jobs:
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Get short commit hash
run: echo "TAG=sha-${GITHUB_SHA::7}" >>${GITHUB_ENV}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -90,7 +94,8 @@ jobs:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
- name: Deploy demo
run: curl -X GET -L --user ${{ secrets.JENKINS_DEMO_TOKEN }} "${{ secrets.JENKINS_DEMO_URL }}/buildWithParameters?token=${{ secrets.JENKINS_DEMO_JOB_TOKEN }}&DOCKER_IMAGE=${{ env.REPO }}:${{ env.TAG }}"
run: curl -X GET -L --user ${{ secrets.JENKINS_DEMO_TOKEN }} "${{ secrets.JENKINS_DEMO_URL }}/buildWithParameters?token=${{ secrets.JENKINS_DEMO_JOB_TOKEN }}&DOCKER_IMAGE=ghcr.io/${{ env.REPO }}:${{ env.TAG }}"
- name: Deploy to Jenkins
run: curl -X GET -L --user ${{ secrets.JENKINS_TOKEN }} "${{ secrets.JENKINS_URL }}/buildWithParameters?token=${{ secrets.JENKINS_JOB_TOKEN }}&DOCKER_IMAGE=${{ env.REPO }}:${{ env.TAG }}"
run: curl -X GET -L --user ${{ secrets.JENKINS_TOKEN }} "${{ secrets.JENKINS_URL }}/buildWithParameters?token=${{ secrets.JENKINS_JOB_TOKEN }}&DOCKER_IMAGE=ghcr.io/${{ env.REPO }}:${{ env.TAG }}"

0 comments on commit 7002906

Please sign in to comment.