From 8fef4a5aea322d6c297aa1c397a6dcb8bfc4d1ce Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Mon, 10 Jun 2024 12:37:47 +0100 Subject: [PATCH] Autodeploy Gemini --- .github/workflows/publish.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7013c2bb..96a54bec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,11 +66,19 @@ jobs: key: ${{ env.cache-name }} - name: Build site run: task build - - name: Upload artifact + - name: Upload site artifact uses: actions/upload-pages-artifact@v1 with: name: site path: ./public + - name: Build Gemini capsule + run: task gemini-reduce + - name: Upload capsule artifact + uses: actions/upload-pages-artifact@v1 + with: + name: capsule + path: ./public + # Deployment job deploy: @@ -114,3 +122,21 @@ jobs: cid: ${{ steps.Publish.outputs.cid }} token: ${{ secrets.CLOUDFLARE_TOKEN }} zone: ${{ secrets.CLOUDFLARE_ZONE_ID }} + + gemini-deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Prepare for Fly deployment (Gemini) + uses: superfly/flyctl-actions/setup-flyctl@master + - uses: actions/download-artifact@v3 + with: + name: capsule + path: ./public + - name: Extract Github Pages artifact + working-directory: ./public + run: tar -xf ./artifact.tar + - name: Deploy Gemini site + run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}