From 17d49a5644c5fdf755d4231dc0a928238ceccbdf Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Thu, 25 Apr 2024 16:52:56 +0200 Subject: [PATCH] Assert that deployment actually succeeds --- .github/workflows/functional.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index e42e1e6..23c2a46 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -43,6 +43,10 @@ jobs: env: MITTWALD_SSH_PRIVATE_KEY: ${{ secrets.MITTWALD_SSH_PRIVATE_KEY }} + - name: Generate unique test file + run: | + openssl rand -hex 32 > testing.txt + - name: Run test deployment run: | ./vendor/bin/dep deploy -vvv @@ -50,3 +54,15 @@ jobs: MITTWALD_APP_ID: ${{ secrets.MITTWALD_APP_ID }} MITTWALD_APP_DOMAIN: ${{ secrets.MITTWALD_APP_DOMAIN }} MITTWALD_API_TOKEN: ${{ secrets.MITTWALD_API_TOKEN }} + + - name: Assert deployment was successful + run: | + deployed=$(curl -f -s https://${MITTWALD_APP_DOMAIN}/testing.txt) + expected=$(< testing.txt) + + echo "::debug::got output: ${deployed}" + echo "::debug::expected: ${expected}" + + test "${deployed}" = "${expected}" + env: + MITTWALD_APP_DOMAIN: ${{ secrets.MITTWALD_APP_DOMAIN }} \ No newline at end of file