Add test-frontend, build-backend, and build-frontend stages to CI workflow
Some checks failed
Some checks failed
This commit is contained in:
parent
28c89c6384
commit
ff4fd327d1
1 changed files with 80 additions and 1 deletions
|
|
@ -123,4 +123,83 @@ jobs:
|
|||
|
||||
- name: Debug DB (on failure)
|
||||
if: failure()
|
||||
run: podman --remote logs --tail=200 test-postgres-${{ env.RUN_ID }} || true
|
||||
run: podman --remote logs --tail=200 test-postgres-${{ env.RUN_ID }} || true
|
||||
|
||||
test-frontend:
|
||||
runs-on: [ci]
|
||||
needs: test-backend
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Pass-through (no frontend tests yet)
|
||||
run: echo "Frontend tests placeholder - no tests implemented yet"
|
||||
|
||||
build-backend:
|
||||
runs-on: [ci]
|
||||
needs: [test-backend, test-frontend]
|
||||
|
||||
env:
|
||||
CONTAINER_HOST: unix:///run/user/1001/podman/podman.sock
|
||||
XDG_RUNTIME_DIR: /tmp
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
BACKEND_IMAGE: ${{ secrets.REGISTRY_HOST }}/${{ github.repository }}/sharenet-backend-api-postgres
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to container registry with PAT
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | podman --remote login \
|
||||
-u "${{ secrets.REGISTRY_USERNAME }}" \
|
||||
--password-stdin \
|
||||
"${{ secrets.REGISTRY_HOST }}"
|
||||
|
||||
- name: Build backend container image
|
||||
run: |
|
||||
podman --remote build \
|
||||
-f backend/Dockerfile \
|
||||
-t "$BACKEND_IMAGE:${{ github.sha }}" \
|
||||
-t "$BACKEND_IMAGE:latest" \
|
||||
backend
|
||||
|
||||
- name: Push backend container image
|
||||
run: |
|
||||
podman --remote push "$BACKEND_IMAGE:${{ github.sha }}"
|
||||
podman --remote push "$BACKEND_IMAGE:latest"
|
||||
|
||||
build-frontend:
|
||||
runs-on: [ci]
|
||||
needs: [test-backend, test-frontend]
|
||||
|
||||
env:
|
||||
CONTAINER_HOST: unix:///run/user/1001/podman/podman.sock
|
||||
XDG_RUNTIME_DIR: /tmp
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
FRONTEND_IMAGE: ${{ secrets.REGISTRY_HOST }}/${{ github.repository }}/sharenet-frontend
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to container registry with PAT
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | podman --remote login \
|
||||
-u "${{ secrets.REGISTRY_USERNAME }}" \
|
||||
--password-stdin \
|
||||
"${{ secrets.REGISTRY_HOST }}"
|
||||
|
||||
- name: Build frontend container image
|
||||
run: |
|
||||
podman --remote build \
|
||||
-f frontend/Dockerfile \
|
||||
-t "$FRONTEND_IMAGE:${{ github.sha }}" \
|
||||
-t "$FRONTEND_IMAGE:latest" \
|
||||
frontend
|
||||
|
||||
- name: Push frontend container image
|
||||
run: |
|
||||
podman --remote push "$FRONTEND_IMAGE:${{ github.sha }}"
|
||||
podman --remote push "$FRONTEND_IMAGE:latest"
|
||||
Loading…
Add table
Reference in a new issue