mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 04:44:19 +01:00
Add Deploy step
This commit is contained in:
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
pull_request: ~
|
pull_request: ~
|
||||||
workflow_dispatch: ~
|
workflow_dispatch: ~
|
||||||
|
|
||||||
@@ -18,6 +20,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Lint Dockerfile
|
||||||
|
uses: hadolint/hadolint-action@v3.1.0
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build Docker images
|
- name: Build Docker images
|
||||||
@@ -53,12 +57,17 @@ jobs:
|
|||||||
run: docker compose exec -T php vendor/bin/phpunit
|
run: docker compose exec -T php vendor/bin/phpunit
|
||||||
- name: Doctrine Schema Validator
|
- name: Doctrine Schema Validator
|
||||||
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
|
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
|
||||||
lint:
|
deploy:
|
||||||
name: Docker Lint
|
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
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- shell: bash
|
||||||
uses: actions/checkout@v4
|
env:
|
||||||
- name: Lint Dockerfile
|
PORTAINER_WEBHOOK: ${{secrets.PORTAINER_WEBHOOK}}
|
||||||
uses: hadolint/hadolint-action@v3.1.0
|
run: |
|
||||||
|
curl -v -X POST "$PORTAINER_WEBHOOK"
|
||||||
|
|||||||
Reference in New Issue
Block a user