diff --git a/.github/workflows/testmain.yml b/.github/workflows/testmain.yml index 5df1200..5faa92a 100644 --- a/.github/workflows/testmain.yml +++ b/.github/workflows/testmain.yml @@ -1,8 +1,21 @@ name: setup nginx from the configuration file on: - workflow_dispatch: + push: + branches: ["development"] + workflow_dispatch: + inputs: + config: + description: "Which compose config file to deploy" + required: true + default: "docker-compose.dev.yml" + type: choice + options: + - "docker-compose.dev.yml" + - "docker-compose.stag.yml" + - "docker-compose.yml" + jobs: deploy: runs-on: self-hosted @@ -31,5 +44,27 @@ jobs: run: cp temp_default.conf nginx/nginx_securefit.conf #run: cp nginx/nginx.conf /etc/nginx/conf.d/nginx_securefit.conf + # deploy_test steps - name: Show nginx file run: cat nginx/nginx_securefit.conf + + - name: Checkout repository + uses: actions/checkout@v3 + - name: Dotenv Action + uses: falti/dotenv-action@v1.1.4 + with: + export-variables: true + keys-case: bypass + + - name: Check status of config file + run: | + env + docker compose version + cd $GITHUB_WORKSPACE + docker compose -f $COMPOSE_FILE --verbose config && printf "OK\n" || exit 1 + + - name: Build and run docker image + run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d + + - name: Verify that gateway is available + run: docker ps