From 0bfd4d2e04d1c0fa9543f8323fd3374cfba06016 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 7 Jun 2023 16:57:27 +0200 Subject: [PATCH] CI: Only run SSH key setup step for master branch --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39e25d5f2..b68f3ee5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,12 +139,13 @@ jobs: /usr/src/packages/SRPMS/*.rpm /usr/src/packages/RPMS/x86_64/*.rpm - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} key: ${{ secrets.SSH_KEY }} - name: Create server path - if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci') + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' run: ssh -p ${{secrets.SSH_PORT}} -o StrictHostKeyChecking=no ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} mkdir -p ${{secrets.BUILDS_PATH}}/source ${{secrets.BUILDS_PATH}}/opensuse/${{env.opensuse_subdir}} - name: rsync source if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci') && matrix.opensuse_version == 'tumbleweed' && matrix.qt_version == 'qt6' @@ -258,6 +259,7 @@ jobs: /github/home/rpmbuild/SRPMS/*.rpm /github/home/rpmbuild/RPMS/x86_64/*.rpm - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -364,6 +366,7 @@ jobs: /github/home/rpmbuild/SRPMS/*.rpm /github/home/rpmbuild/RPMS/x86_64/*.rpm - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -463,6 +466,7 @@ jobs: /github/home/rpmbuild/SRPMS/*.rpm /github/home/rpmbuild/RPMS/x86_64/*.rpm - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -556,6 +560,7 @@ jobs: name: debian-${{matrix.debian_version}} path: "*.deb" - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -654,6 +659,7 @@ jobs: *.deb *.ddeb - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -909,6 +915,7 @@ jobs: path: build/*.dmg - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}} @@ -1181,6 +1188,7 @@ jobs: path: build/StrawberrySetup*.exe - name: SSH key setup + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci' uses: shimataro/ssh-key-action@v2 with: known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}