Skip to content

Add initial tests for front-end (#50) #70

Add initial tests for front-end (#50)

Add initial tests for front-end (#50) #70

Workflow file for this run

name: Images
on:
push:
branches:
- main
paths:
- back-end/**
- front-end/**
- Dockerfile
- test/**
- docker-compose*
- .github/workflows/images.yml
pull_request:
branches:
- main
paths:
- back-end/**
- front-end/**
- Dockerfile
- test/**
- docker-compose*
- .github/workflows/images.yml
jobs:
test:
name: Test container images
runs-on: ubuntu-latest
strategy:
matrix:
test:
- host-net
- proxy-pass
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test container images
run: |
docker compose -f docker-compose.test-${{ matrix.test }}.yml up --exit-code-from test
- name: Store logs
if: always()
uses: actions/upload-artifact@v4
with:
name: acceptance-test-${{ matrix.test }}-logs
path: out/
push:
name: Push container images
if: github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push container image to GitHub Container Registry
run: |
docker build back-end/ -t back-end
docker build . --build-arg VITE_BUILD=${{ github.run_number }} -t front-end
for tag in ${{ github.run_number }} latest; do
docker tag back-end ghcr.io/${{ github.repository }}-api:$tag
docker push ghcr.io/${{ github.repository }}-api:$tag
docker tag front-end ghcr.io/${{ github.repository }}-ui:$tag
docker push ghcr.io/${{ github.repository }}-ui:$tag
done