diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..54d9072 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,33 @@ +name: Deploy to TDT4242 server development + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: self-hosted + env: + REPO_NAME: ${{ github.event.repository.name }} + COMPOSE_FILE: ${{ github.event.inputs.config }} + + steps: + - 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 docker-compose.stag.yml --verbose config && printf "OK\n" || exit 1 + + - name: Build and run docker image for tests + run: docker compose -f docker-compose.stag.yml up --force-recreate --build -d + + - name: Verify that gateway is available + run: docker ps