Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Docker

Docker #24

Workflow file for this run

name: Docker
on:
release:
types: [published]
schedule:
- cron: "0 0 * * 0"
pull_request:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository_owner }}/automated-mails"
jobs:
docker:
name: Build Images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@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: Gather Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{version}}.{{major}}
labels: |
cache-from=type=local,src=/tmp/.buildx-cache
cache-to=type=local,dest=/tmp/.buildx-cache
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64