buildTest.yml
local testing
#39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Build Test | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events | |
push: | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
test: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# runs setup script and docker-compose. Outputs Nginx settings | |
- name: Run setup script and start local services | |
env: | |
SERVER_LOCATION: local | |
run: | | |
echo "Running setup script for local environment" | |
chmod +x ./scripts/* | |
set -o pipefail | |
sudo ./scripts/fullSetup.sh -l $SERVER_LOCATION | |
echo "Starting local docker-compose" | |
sudo docker-compose -f docker-compose-local.yml up -d | |
echo "Waiting for services to be ready" | |
sleep 10 | |
echo "Here is the generated Nginx configuration file for local setup" | |
sudo docker exec nginx-local-dev cat /etc/nginx/conf.d/local.conf | |
echo "Testing Nginx is serving content on port 80 (HTTP)" | |
curl -I http://localhost | |
echo "Testing Nginx is serving content on port 443 (HTTPS)" | |
# Use --insecure to allow self-signed certificates | |
curl -I --insecure https://localhost | |
echo "Stopping local docker-compose" | |
sudo docker-compose -f docker-compose-local.yml down |