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
|
branches: main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildx:
|
build-platform:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -35,21 +35,33 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push multi-arch image
|
- name: Build and push platform-specific image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
push: true
|
push: true
|
||||||
tags: albertoxamin/bang:latest
|
tags: albertoxamin/bang:${{ matrix.platform }}
|
||||||
cache-from: type=registry,ref=albertoxamin/bang:latest
|
cache-from: type=registry,ref=albertoxamin/bang:${{ matrix.platform }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
|
|
||||||
- name: Notify discord
|
create-manifest:
|
||||||
uses: th0th/notify-discord@v0.4.1
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() }}
|
needs: build-platform
|
||||||
env:
|
steps:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
- name: Set up Docker Buildx
|
||||||
GITHUB_ACTOR: ${{ github.actor }}
|
uses: docker/setup-buildx-action@v3
|
||||||
GITHUB_JOB_NAME: "Docker multi-arch image :latest"
|
|
||||||
GITHUB_JOB_STATUS: ${{ job.status }}
|
- 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