From 30cf078df560aa8eeebd1aa4fb9aea6d0dd81de1 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Mon, 26 Apr 2021 15:14:21 +0200 Subject: [PATCH 1/2] FIX: the deploy action now only start when the label 'deploy' is applied to the PR --- .github/workflows/build-and-deploy.yml | 14 ++++++++------ .github/workflows/cleanup.yml | 3 ++- .github/workflows/continuous_integration.yml | 7 +++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ce186cec..4ed83831 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -1,7 +1,9 @@ name: Build, push and deploy Docker image on: - - push + pull_request: + types: [ labeled, synchronize ] + # Enables BuildKit env: @@ -10,7 +12,7 @@ env: jobs: build-front: - + if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} runs-on: ubuntu-latest steps: @@ -34,7 +36,7 @@ jobs: add_git_labels: true build-back: - + if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} runs-on: ubuntu-latest steps: @@ -57,7 +59,7 @@ jobs: add_git_labels: true build-pusher: - + if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} runs-on: ubuntu-latest steps: @@ -80,7 +82,7 @@ jobs: add_git_labels: true build-uploader: - + if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} runs-on: ubuntu-latest steps: @@ -103,7 +105,7 @@ jobs: add_git_labels: true build-maps: - + if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index bb6bcc89..558a2c3e 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -1,7 +1,8 @@ name: Cleanup images and environments on: - - delete + pull_request: + types: [ closed ] # Enables BuildKit env: diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 607dbf79..38d8c8f0 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -3,8 +3,11 @@ name: "Continuous Integration" on: - - "pull_request" - - "push" + push: + branches: + - master + - develop + pull_request: jobs: From ea009d912ef44bdbaaad9253fbdcd18e91e9ff21 Mon Sep 17 00:00:00 2001 From: kharhamel Date: Tue, 27 Apr 2021 16:00:25 +0200 Subject: [PATCH 2/2] edited CD domain in deeployer config --- .github/workflows/build-and-deploy.yml | 2 +- deeployer.libsonnet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 4ed83831..d6ec1acd 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -162,5 +162,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - msg: Environment deployed at https://play.${{ env.GITHUB_REF_SLUG }}.workadventure.test.thecodingmachine.com + msg: Environment deployed at https://play.${{ env.GITHUB_REF_SLUG }}.test.workadventu.re check_for_duplicate_msg: true diff --git a/deeployer.libsonnet b/deeployer.libsonnet index 07506f11..3eeaa359 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -2,7 +2,7 @@ local env = std.extVar("env"), local namespace = env.GITHUB_REF_SLUG, local tag = namespace, - local url = if namespace == "master" then "workadventu.re" else namespace+".workadventure.test.thecodingmachine.com", + local url = if namespace == "master" then "workadventu.re" else namespace+".test.workadventu.re", // develop branch does not use admin because of issue with SSL certificate of admin as of now. local adminUrl = if namespace == "master" || namespace == "develop" || std.startsWith(namespace, "admin") then "https://"+url else null, "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json",