Skip to content

Merge pull request #288 from T145/develop #372

Merge pull request #288 from T145/develop

Merge pull request #288 from T145/develop #372

---
# https://docs.docker.com/ci-cd/github-actions/
name: Publish Docker Image
on:
push:
branches: ["master"]
paths: ["docker/Dockerfile"]
workflow_dispatch:
permissions: read-all
jobs:
build:
runs-on: ubuntu-22.04
permissions:
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build the image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: ./docker/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ghcr.io/t145/black-mirror:latest
cache-from: type=registry,ref=ghcr.io/t145/black-mirror:buildcache
cache-to: type=registry,ref=ghcr.io/t145/black-mirror:buildcache,mode=max
# https://github.com/kitabisa/docker-slim-action
# - name: Slim the image
# uses: kitabisa/docker-slim-action@e641d62304259303c8557c27e10965f7348c7eb4
# env:
# DSLIM_HTTP_PROBE: false
# with:
# target: ${{ github.repository }}:latest
# tag: 'slim'
# - name: Push all tags
# run: docker image push "${{ github.repository }}" --all-tags