Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/docker_local_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker build (cache w/ docker)

on:
workflow_dispatch:
push:
branches: [ "master", "main", "maint/*", "gha-docker-build" ]
tags: "*"
pull_request:
branches: [ "master", "main", "maint/*" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
FORCE_COLOR: true

jobs:
build-container:
runs-on: local
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 200
fetch-tags: true

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin

- name: Extract Docker metadata
id: meta
run: |
# Simple tag generation
TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "labels=" >> $GITHUB_OUTPUT

- name: Build and push Docker image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main .
Loading