From cfb69c8dabcfb0419a456037609399cf899ac205 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Mon, 8 Sep 2025 20:51:41 +0200 Subject: [PATCH] Add Deploy step --- .github/workflows/ci.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ac5d74..a55d77c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - '*' pull_request: ~ workflow_dispatch: ~ @@ -18,6 +20,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Lint Dockerfile + uses: hadolint/hadolint-action@v3.1.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build Docker images @@ -53,12 +57,17 @@ jobs: run: docker compose exec -T php vendor/bin/phpunit - name: Doctrine Schema Validator run: docker compose exec -T php bin/console -e test doctrine:schema:validate - lint: - name: Docker Lint + deploy: + name: Deploy + environment: + name: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || (github.ref == 'refs/heads/main' && 'acceptance' || '') }} + url: ${{ vars.URL }} + needs: tests runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Lint Dockerfile - uses: hadolint/hadolint-action@v3.1.0 - + - shell: bash + env: + PORTAINER_WEBHOOK: ${{secrets.PORTAINER_WEBHOOK}} + run: | + curl -v -X POST "$PORTAINER_WEBHOOK"