From 93c2a17811c20b958d9a615ce5d00dcc01fb7146 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 9 Feb 2024 23:45:33 +0100 Subject: [PATCH] Deploy to the new preview server --- .../deploy-documentation-preview.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/deploy-documentation-preview.yml b/.github/workflows/deploy-documentation-preview.yml index e4bb1378bef..3ef9c374e63 100644 --- a/.github/workflows/deploy-documentation-preview.yml +++ b/.github/workflows/deploy-documentation-preview.yml @@ -94,3 +94,26 @@ jobs: - name: Compile the static site run: php hyde build + + - name: Package the static site + run: zip -r site.zip _site + + - name: Sign the artifact + run: openssl dgst -sha256 -sign ${{ secrets.CI_PREVIEW_SIGNING_RSA_PRIVATE_KEY }} -out signature.bin site.zip + + - name: Upload the artifact + run: | + repository="develop" + bearerToken="${{ secrets.CI_SERVER_TOKEN }}" + pullRequest="${{ github.event.pull_request.number }}" + signature=$(openssl base64 -in signature.bin) + artifact="site.zip" + + curl -X POST \ + -H 'Content-Type: multipart/form-data' \ + -H "Authorization: Bearer $bearerToken" \ + -F 'repository=$repository \ + -F 'pullRequest=$pullRequest' \ + -F 'artifact=@$artifact' \ + -F 'signature=$signature' \ + https://ci.hydephp.com/api/deployment-previews