Skip to content

NES - Complete

NES - Complete #174

name: NES - Complete
on:
schedule:
- cron: '0 11 * * 3' # Runs at 11:00 UTC every Wednesday
workflow_dispatch:
jobs:
docker-build-and-run:
runs-on: ubuntu-latest
timeout-minutes: 15 # Set a timeout of 15 minutes for this job
environment: production
strategy:
max-parallel: 1
matrix:
branch: [
angular-v5-nes-complete,
angular-v6-nes-complete,
angular-v7-nes-complete,
angular-v8-nes-complete,
angular-v9-nes-complete,
angular-v10-nes-complete,
angular-v11-nes-complete,
angular-v12-nes-complete,
angular-v13-nes-complete,
angular-v14-nes-complete,
angular-v15-nes-complete,
angular-v16-nes-complete
]
fail-fast: false # Allows all matrix jobs to run to completion
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- name: Build the Docker image
run: |
docker build --no-cache . --file Dockerfile --tag ${{ matrix.branch }} --build-arg NES_AUTH_TOKEN=${{ secrets.NES_AUTH_TOKEN }}
- name: Run Docker container
run: |
docker run -d -p 4200:4200 --name ${{ matrix.branch }} ${{ matrix.branch }}
sleep 10 # Give some time for the application to start
- name: Check Docker container logs
run: |
docker logs ${{ matrix.branch }}
- name: Check Docker container exit status
run: |
sleep 10 # Additional wait time if needed
CONTAINER_EXIT_CODE=$(docker inspect ${{ matrix.branch }} --format='{{.State.ExitCode}}')
if [ "$CONTAINER_EXIT_CODE" != "0" ]; then
echo "Container exited with code $CONTAINER_EXIT_CODE"
exit 1
fi