ci: implement certificate caching in workflow

This commit is contained in:
ramvignesh-b
2026-04-16 05:34:08 +05:30
parent 3f761cfe7e
commit 2e0c4e557d
2 changed files with 18 additions and 5 deletions
+14 -1
View File
@@ -10,7 +10,8 @@ jobs:
setup-environment:
name: Generate Certificates
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cert-key.outputs.key }}
steps:
- uses: actions/checkout@v4
- name: Generate SSL Certificates
@@ -19,6 +20,11 @@ jobs:
mkdir -p certs
mkcert -install
mkcert -cert-file certs/localhost.pem -key-file certs/localhost-key.pem localhost 127.0.0.1 ::1
echo "cert_path=certs/localhost.pem" >> $GITHUB_OUTPUT
echo "key_path=certs/localhost-key.pem" >> $GITHUB_OUTPUT
- id: cert-key
run: echo "key=${{ runner.os }}-certs-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Cache certificates
uses: actions/cache/save@v4
@@ -63,6 +69,7 @@ jobs:
backend:
name: Backend CI
runs-on: ubuntu-latest
needs: setup-environment
defaults:
run:
working-directory: ./backend
@@ -84,6 +91,12 @@ jobs:
enable-cache: true
cache-dependency-glob: backend/uv.lock
- name: Restore certificates
uses: actions/cache/restore@v4
with:
path: certs
key: ${{ runner.os }}-certs-${{ github.sha }}
- name: Setup Environment
run: |
cp ../.env.example ../.env