mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-02 11:58:12 +03:00
feat: significantly better ci images (#1516)
This commit is contained in:
@@ -38,7 +38,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
env:
|
||||
NODE_ENV: "test"
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
needs: test
|
||||
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -53,16 +53,39 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||
|
||||
- name: Build and push
|
||||
# `tachi-ci` = the minimal `base` stage. Used as the `container:` image
|
||||
# for every workspace CI job. Kept small so the per-job image pull is
|
||||
# cheap.
|
||||
- name: Build and push tachi-ci (base stage)
|
||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.dev
|
||||
target: base
|
||||
push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
ghcr.io/zkldi/tachi-ci:main
|
||||
ghcr.io/zkldi/tachi-ci:latest
|
||||
ghcr.io/zkldi/tachi-ci:${{ steps.revision.outputs.image_tag }}
|
||||
ghcr.io/zkldi/tachi-ci:${{ github.sha }}
|
||||
cache-from: type=gha,scope=dev-image-base
|
||||
cache-to: type=gha,mode=max,scope=dev-image-base
|
||||
|
||||
# `tachi-dev` = full devcontainer image (`dev` stage on top of `base`).
|
||||
# Pulled by devs once and rebuilt rarely; CI never touches it.
|
||||
- name: Build and push tachi-dev (dev stage)
|
||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.dev
|
||||
target: dev
|
||||
push: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
ghcr.io/zkldi/tachi-dev:main
|
||||
ghcr.io/zkldi/tachi-dev:latest
|
||||
ghcr.io/zkldi/tachi-dev:${{ steps.revision.outputs.image_tag }}
|
||||
ghcr.io/zkldi/tachi-dev:${{ github.sha }}
|
||||
cache-from: type=gha,scope=dev-image
|
||||
cache-to: type=gha,mode=max,scope=dev-image
|
||||
cache-from: |
|
||||
type=gha,scope=dev-image-dev
|
||||
type=gha,scope=dev-image-base
|
||||
cache-to: type=gha,mode=max,scope=dev-image-dev
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||
steps:
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/zkldi/tachi-dev:main
|
||||
image: ghcr.io/zkldi/tachi-ci:main
|
||||
options: --user root
|
||||
env:
|
||||
NODE_ENV: "test"
|
||||
|
||||
Reference in New Issue
Block a user