![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
name: Docker Images CI
|
|
on:
|
|
push:
|
|
branches: main
|
|
|
|
jobs:
|
|
buildx:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: crazy-max/ghaction-docker-buildx@v3
|
|
-
|
|
name: Cache Docker layers
|
|
uses: actions/cache@v3
|
|
id: cache
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
-
|
|
name: Docker Buildx (build amd64 arm64)
|
|
run: |
|
|
docker buildx build \
|
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--output "type=image,push=false" \
|
|
--tag albertoxamin/bang:latest \
|
|
--file ./Dockerfile ./
|
|
-
|
|
name: Docker Buildx (build armv-7)
|
|
run: |
|
|
docker buildx build \
|
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
|
--platform linux/arm/v7 \
|
|
--output "type=image,push=false" \
|
|
--tag albertoxamin/bang:latest \
|
|
--file ./Dockerfile ./
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
-
|
|
name: Docker Buildx (push all)
|
|
run: |
|
|
docker buildx build \
|
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
|
--output "type=image,push=true" \
|
|
--tag albertoxamin/bang:latest \
|
|
--file ./Dockerfile ./
|
|
-
|
|
name: Inspect image
|
|
run: |
|
|
docker buildx imagetools inspect albertoxamin/bang:latest
|
|
|
|
- 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 image main :latest"
|
|
GITHUB_JOB_STATUS: ${{ job.status }}
|