💚 Improve docker image build

This commit is contained in:
Daniel 2025-05-27 17:41:22 +08:00
parent ba4628f6ae
commit b57e1bdc94
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -57,17 +57,17 @@ jobs:
docker-images: true docker-images: true
swap-storage: true swap-storage: true
- name: Set up QEMU # - name: Set up QEMU
uses: docker/setup-qemu-action@v3 # uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx - name: Setup Docker buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub # - name: Log in to Docker Hub
uses: docker/login-action@v3 # uses: docker/login-action@v3
with: # with:
username: ${{ secrets.DOCKER_HUB_USER }} # username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }} # password: ${{ secrets.DOCKER_HUB_PWD }}
- name: Build the Docker image use Workflow Dispatch inputs' version - name: Build the Docker image use Workflow Dispatch inputs' version
if: ${{ github.event_name == 'workflow_dispatch' && !github.event.inputs.image_tag == '' }} if: ${{ github.event_name == 'workflow_dispatch' && !github.event.inputs.image_tag == '' }}
@ -76,4 +76,4 @@ jobs:
- name: Build the Docker image use package_json version - name: Build the Docker image use package_json version
if: ${{ github.event_name == 'push' || github.event.inputs.image_tag == '' }} if: ${{ github.event_name == 'push' || github.event.inputs.image_tag == '' }}
run: | run: |
docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:v${{ steps.version.outputs.value }} . docker buildx build --platform linux/amd64 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:v${{ steps.version.outputs.value }} .