From 1266334111277680660f3aa57c9f5f67bdc46c16 Mon Sep 17 00:00:00 2001 From: David Jennes Date: Sun, 21 Apr 2024 02:43:32 +0200 Subject: [PATCH] CI: add github actions --- .../workflows/auto-deploy-to-development.yml | 20 +++++++++++++ .github/workflows/promote-to-enviroment.yml | 28 +++++++++++++++++++ .github/workflows/pullrequest-check.yml | 15 ++++++++++ 3 files changed, 63 insertions(+) create mode 100644 .github/workflows/auto-deploy-to-development.yml create mode 100644 .github/workflows/promote-to-enviroment.yml create mode 100644 .github/workflows/pullrequest-check.yml diff --git a/.github/workflows/auto-deploy-to-development.yml b/.github/workflows/auto-deploy-to-development.yml new file mode 100644 index 0000000..3995f8c --- /dev/null +++ b/.github/workflows/auto-deploy-to-development.yml @@ -0,0 +1,20 @@ +--- +name: Auto-deploy to development + +on: # yamllint disable-line rule:truthy + push: + branches: ['main'] + workflow_dispatch: + +jobs: + build-and-deploy: + uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-build-and-deploy-scaleway.yml@main + with: + environment: development + scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }} + scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }} + scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }} + scaleway-region: ${{ vars.SCALEWAY_REGION }} + scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }} + cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }} + secrets: inherit diff --git a/.github/workflows/promote-to-enviroment.yml b/.github/workflows/promote-to-enviroment.yml new file mode 100644 index 0000000..48b973c --- /dev/null +++ b/.github/workflows/promote-to-enviroment.yml @@ -0,0 +1,28 @@ +--- +name: Promote to enviroment + +on: # yamllint disable-line rule:truthy + workflow_dispatch: + inputs: + environment: + description: Target environment to deploy TO + type: environment + required: true + source-tag: + description: Source tag (defaults to previous environment) + type: string + required: false + +jobs: + promote-to-env: + uses: wisemen-digital/devops-github-actions/.github/workflows/workflow-promote-to-environment-scaleway.yml@main + with: + environment-source: ${{ inputs.source-tag }} + environment-target: ${{ inputs.environment }} + scaleway-container-registry: ${{ vars.CONTAINER_REGISTRY_ENDPOINT }} + scaleway-organization-id: ${{ vars.SCALEWAY_ORGANIZATION_ID }} + scaleway-project-id: ${{ vars.SCALEWAY_PROJECT_ID }} + scaleway-region: ${{ vars.SCALEWAY_REGION }} + scaleway-cluster-id: ${{ vars.K8S_CLUSTER_ID }} + cluster-deployments: ${{ vars.K8S_DEPLOYMENTS }} + secrets: inherit diff --git a/.github/workflows/pullrequest-check.yml b/.github/workflows/pullrequest-check.yml new file mode 100644 index 0000000..61c265e --- /dev/null +++ b/.github/workflows/pullrequest-check.yml @@ -0,0 +1,15 @@ +--- +name: PR Check + +on: # yamllint disable-line rule:truthy + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - main + +jobs: + lint-build-test: + uses: wisemen-digital/devops-github-actions/.github/workflows/laravel-build-and-test.yml@main + if: github.event.pull_request.draft == false + with: + php-version: '8.3'