Update docker-image.yml
This commit is contained in:
parent
123e569010
commit
6bc10f1bff
36
.github/workflows/docker-image.yml
vendored
36
.github/workflows/docker-image.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
branches: main
|
||||
|
||||
jobs:
|
||||
buildx:
|
||||
build-platform:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
@ -35,21 +35,33 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
- name: Build and push platform-specific image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: ${{ matrix.platform }}
|
||||
push: true
|
||||
tags: albertoxamin/bang:latest
|
||||
cache-from: type=registry,ref=albertoxamin/bang:latest
|
||||
tags: albertoxamin/bang:${{ matrix.platform }}
|
||||
cache-from: type=registry,ref=albertoxamin/bang:${{ matrix.platform }}
|
||||
cache-to: type=inline
|
||||
|
||||
- name: Notify discord
|
||||
uses: th0th/notify-discord@v0.4.1
|
||||
if: ${{ always() }}
|
||||
env:
|
||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_JOB_NAME: "Docker multi-arch image :latest"
|
||||
GITHUB_JOB_STATUS: ${{ job.status }}
|
||||
create-manifest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-platform
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Create and push multi-arch manifest
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
--tag albertoxamin/bang:latest \
|
||||
albertoxamin/bang:linux/amd64 \
|
||||
albertoxamin/bang:linux/arm/v7 \
|
||||
albertoxamin/bang:linux/arm64/v8
|
||||
|
Loading…
Reference in New Issue
Block a user