Skip to content

Commit

Permalink
CI: modernize builder
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Oct 3, 2024
1 parent a50b959 commit 544b1dc
Showing 1 changed file with 15 additions and 43 deletions.
58 changes: 15 additions & 43 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
name: Docker
name: "Docker"

on:
workflow_dispatch:

push:
branches: ["*"]
branches: ["master"]

schedule:
- cron: "0 8 * * 1"

jobs:
docker:
runs-on: ubuntu-latest
build:
name: "Build"
uses: dockette/.github/.github/workflows/docker.yml@master
secrets: inherit
with:
image: "dockette/deploy"
tag: "${{ matrix.tag }}"
context: "${{ matrix.context }}"
strategy:
matrix:
include:
- tag: "deployer7"
context: "deployer/v7"
- tag: "deployer6"
context: "deployer/v6"

fail-fast: false

name: Docker (dockette/deploy:${{ matrix.tag }})

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.tag }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
context: ${{ matrix.context }}
push: true
tags: dockette/deploy:${{ matrix.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: ${{ matrix.platforms || 'linux/amd64,linux/arm64' }}

0 comments on commit 544b1dc

Please sign in to comment.