diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 70dc2bfa502..e40b18eb69b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,8 +1,12 @@ -name: Deploy +name: Deploy Main on: - push: {} - pull_request: {} + push: + branches: + - main + pull_request: + branches: + - main jobs: deploy: @@ -22,7 +26,7 @@ jobs: env: NODE_ENV: production - name: Set up SSH - if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch + if: github.event_name == 'push' && github.ref_name == 'main' run: | mkdir ~/.ssh echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub @@ -30,12 +34,12 @@ jobs: chmod 600 ~/.ssh/* ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts - name: Deploy build on server - if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch + if: github.event_name == 'push' && github.ref_name == 'main' run: | rsync --del --no-times --checksum -vrm dist/* ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.DESTINATION_DIR }} ssh -t ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "~/prmanifest --inpath ${{ secrets.DESTINATION_DIR }} --outpath ${{ secrets.DESTINATION_DIR }}/manifest.json" - name: Purge Cloudflare Cache - if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch + if: github.event_name == 'push' && github.ref_name == 'main' id: purge-cache uses: NathanVaughn/actions-cloudflare-purge@v3.1.0 with: