Skip to content

zswatch: Optimize to keep container small to work with Github hosted … #2

zswatch: Optimize to keep container small to work with Github hosted …

zswatch: Optimize to keep container small to work with Github hosted … #2

name: Build and publish ZSWatch CI image
on:
push:
branches:
- main
- zswatch_*
paths:
- Dockerfile.base
- Dockerfile.ci
- .github/workflows/zswatch-ci-image.yml
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build base image (local only)
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.base
push: false
load: true
tags: ci-base:local
- name: Build and push CI image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.ci
push: true
tags: |
ghcr.io/zswatch/zswatch-ci:latest
ghcr.io/zswatch/zswatch-ci:${{ github.ref_name }}
build-args: |
BASE_IMAGE=ci-base:local