From 33d1626cb1e5b8b72f40d675852c720a000bb621 Mon Sep 17 00:00:00 2001 From: Camilla Date: Fri, 7 Mar 2025 15:24:13 +0100 Subject: [PATCH] new temp yaml file --- .github/workflows/deploy_test_2.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy_test_2.yml diff --git a/.github/workflows/deploy_test_2.yml b/.github/workflows/deploy_test_2.yml new file mode 100644 index 0000000..a14f485 --- /dev/null +++ b/.github/workflows/deploy_test_2.yml @@ -0,0 +1,43 @@ +name: Deploy to TDT4242 server development + +on: + 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 + 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 $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