forked from enviPath/enviPy
This is meant to drastically speed up CI because it skips the lengthy installation. Co-authored-by: jebus <lorsbach@envipath.com> Reviewed-on: enviPath/enviPy#268 Co-authored-by: Tobias O <tobias.olenyi@envipath.com> Co-committed-by: Tobias O <tobias.olenyi@envipath.com>
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: Build CI Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- main
|
|
paths:
|
|
- '.gitea/docker/Dockerfile.ci'
|
|
- '.gitea/workflows/build-ci-image.yaml'
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.envipath.com
|
|
username: ${{ secrets.CI_REGISTRY_USER }}
|
|
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: git.envipath.com/envipath/envipy-ci
|
|
tags: |
|
|
type=raw,value=latest
|
|
type=sha,prefix={{branch}}-
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: .gitea/docker/Dockerfile.ci
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=registry,ref=git.envipath.com/envipath/envipy-ci:latest
|
|
cache-to: type=inline
|