diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77831f5..d872141 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,9 @@ on: branches: - "*" types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: false jobs: build: name: Build binaries @@ -43,3 +46,35 @@ jobs: name: ${{matrix.configuration}} binaries path: | build/bin/${{matrix.configuration}}/iw5-gsc-utils.dll + deploy: + name: Deploy artifacts + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && (github.ref == 'refs/heads/main') + steps: + - name: Setup main environment + if: github.ref == 'refs/heads/main' + run: echo "ALICE_MASTER_PATH=${{ secrets.ALICE_MASTER_SSH_PATH }}" >> $GITHUB_ENV + + - name: Download Release binaries + uses: actions/download-artifact@v4 + with: + name: Release binaries + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2.7.0 + with: + key: ${{ secrets.ALICE_MASTER_SSH_PRIVATE_KEY }} + known_hosts: 'just-a-placeholder-so-we-dont-get-errors' + + - name: Add known hosts + run: ssh-keyscan -H ${{ secrets.ALICE_MASTER_SSH_ADDRESS }} >> ~/.ssh/known_hosts + + - name: Remove old data files + run: ssh ${{ secrets.ALICE_MASTER_SSH_USER }}@${{ secrets.ALICE_MASTER_SSH_ADDRESS }} rm -rf ${{ env.ALICE_MASTER_PATH }}/iw5-gsc-utils/* + + - name: Upload binary + run: rsync -avz iw5-gsc-utils.dll ${{ secrets.ALICE_MASTER_SSH_USER }}@${{ secrets.ALICE_MASTER_SSH_ADDRESS }}:${{ env.ALICE_MASTER_PATH }}/iw5-gsc-utils/ + + - name: Publish changes + run: ssh ${{ secrets.ALICE_MASTER_SSH_USER }}@${{ secrets.ALICE_MASTER_SSH_ADDRESS }} ${{ secrets.ALICE_MASTER_SSH_CHANGE_PUBLISH_COMMAND }}