commit 8600bfa2ec607da275a96ce1d4a88b08e33979a0
parent d829f25a7e8cc9002ab786f0f12d87afce8e88bf
Author: Asher Morgan <asher@ashermorgan.net>
Date: Sun, 13 Sep 2026 18:42:36 -0700
Refactor CI/CD
Diffstat:
3 files changed, 95 insertions(+), 83 deletions(-)
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
@@ -1,55 +0,0 @@
-# See https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images#publishing-images-to-github-packages
-name: Build Docker image
-
-on:
- push:
- branches: master
-
-env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
-
-jobs:
- build-and-push-image:
- runs-on: ubuntu-latest
-
- permissions:
- contents: read
- packages: write
- attestations: write
- id-token: write
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
-
- - name: Log in to the Container registry
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Extract metadata (tags, labels) for Docker
- id: meta
- uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
- with:
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- tags: |
- type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
-
- - name: Build and push Docker image
- id: push
- uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
- with:
- context: .
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
-
- - name: Generate artifact attestation
- uses: actions/attest@v4
- with:
- subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
- subject-digest: ${{ steps.push.outputs.digest }}
- push-to-registry: true
diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml
@@ -0,0 +1,95 @@
+name: AoH CI/CD
+
+on:
+ push:
+ paths-ignore:
+ - README.md
+
+ pull_request:
+ paths-ignore:
+ - README.md
+
+env:
+ REGISTRY: ghcr.io
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ run-unit-tests:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+
+ - name: Run unit tests
+ run: python -m unittest tests.unit
+
+
+ run-e2e-tests:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Run end-to-end tests
+ run: ./tests/e2e/run.sh
+
+
+ build-and-push-image:
+ runs-on: ubuntu-latest
+
+ if: github.ref == 'refs/heads/master'
+
+ needs:
+ - run-unit-tests
+ - run-e2e-tests
+
+ permissions:
+ contents: read
+ packages: write
+ attestations: write
+ id-token: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v6
+
+ - name: Log in to the Container registry
+ uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ tags: |
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
+
+ - name: Build and push Docker image
+ id: push
+ uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
+ with:
+ context: .
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+
+ - name: Generate artifact attestation
+ uses: actions/attest@v4
+ with:
+ subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ subject-digest: ${{ steps.push.outputs.digest }}
+ push-to-registry: true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -1,28 +0,0 @@
-name: Run tests
-
-on:
- push:
- pull_request:
-
-jobs:
- run-tests:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v6
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.x'
-
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install -r requirements.txt
-
- - name: Run unit tests
- run: python -m unittest tests.unit
-
- - name: Run end-to-end tests
- run: ./tests/e2e/run.sh