From b3b204f28035645408fd585b35963aa1b7e232cd Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Sat, 4 Feb 2023 11:05:58 +0100 Subject: [PATCH 1/2] add deploy by label to naos --- .github/workflows/deploy-naos.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-naos.yml b/.github/workflows/deploy-naos.yml index 6c4d2bec43..fde5282d7a 100644 --- a/.github/workflows/deploy-naos.yml +++ b/.github/workflows/deploy-naos.yml @@ -2,6 +2,9 @@ name: Deploy Naos on: workflow_dispatch: + pull_request: + types: + - labeled concurrency: group: deploy-naos @@ -9,6 +12,7 @@ concurrency: jobs: deploy: + if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'deploy naos') }} environment: name: naos url: https://naos.ugent.be @@ -21,4 +25,11 @@ jobs: known_hosts: ${{ secrets.MESTRA_HOST }} - name: Run deploy run: | - echo "deploy naos $GITHUB_REF" | ssh -p 4840 dodona@mestra.ugent.be + echo "deploy naos $GITHUB_SHA" | ssh -p 4840 dodona@mestra.ugent.be + - name: Remove deploy label + if: github.event.action == 'labeled' + uses: buildsville/add-remove-label@v1 + with: + token: ${{secrets.GITHUB_TOKEN}} + label: deploy naos + type: remove From c1c1e996deb2a7e301f96fab5377eb5ccfc459dc Mon Sep 17 00:00:00 2001 From: Bart Mesuere Date: Sat, 4 Feb 2023 11:08:21 +0100 Subject: [PATCH 2/2] tweak mestra deploy script --- .github/workflows/deploy-mestra.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-mestra.yml b/.github/workflows/deploy-mestra.yml index 37197982eb..44559d8cf0 100644 --- a/.github/workflows/deploy-mestra.yml +++ b/.github/workflows/deploy-mestra.yml @@ -12,7 +12,7 @@ concurrency: jobs: deploy: - if: ${{ github.event.action == 'labeled' && github.event.label.name == 'deploy' }} + if: ${{ github.event.action != 'labeled' || (github.event.action == 'labeled' && github.event.label.name == 'deploy mestra') }} environment: name: mestra url: https://mestra.ugent.be @@ -26,9 +26,10 @@ jobs: - name: Run deploy run: | echo "deploy mestra $GITHUB_SHA" | ssh -p 4840 dodona@mestra.ugent.be - - name: Remove deploy label + - name: Remove deploy label + if: github.event.action == 'labeled' uses: buildsville/add-remove-label@v1 with: token: ${{secrets.GITHUB_TOKEN}} - label: deploy + label: deploy mestra type: remove