Skip to content

Optimize CI by using a custom Docker container with pre-installed dep… #3

Optimize CI by using a custom Docker container with pre-installed dep…

Optimize CI by using a custom Docker container with pre-installed dep… #3

name: Build CI Container
on:
push:
paths:
- '.ci/container/**'
- '.github/workflows/build-container.yml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Downcase Image Name
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}/ci-container" >> ${GITHUB_ENV}
- 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:
context: .ci/container
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest