From bd22d3d9cb6e17355aaa18085f3fbe8b6c591216 Mon Sep 17 00:00:00 2001 From: Vaughn Dice Date: Thu, 27 Mar 2025 11:34:55 -0600 Subject: [PATCH] ci(.github): add deploy.yaml Signed-off-by: Vaughn Dice --- .github/workflows/build.yaml | 19 +++++++++++++++ .github/workflows/deploy.yaml | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 73646ede..a088024a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,6 +2,7 @@ name: Build on: pull_request: branches: [main] + workflow_call: env: BART_VERSION: v0.10.0 @@ -51,3 +52,21 @@ jobs: - name: Run npm tests run: | npm test + + - name: Archive app artifacts + uses: actions/upload-artifact@v4 + with: + name: app + # These are all of the paths referenced in spin.toml + path: | + spin.toml + modules/*.wasm + content/**/* + templates/* + scripts/* + config/* + shortcodes/* + static/**/* + downloads/**/* + spin-redirect.json + spin-up-hub/dist/**/* diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..b4aac045 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,44 @@ +name: Deploy Spin Docs + +on: + push: + branches: + - 'main' + + workflow_dispatch: + +# Construct a concurrency group to be shared across workflow runs. +# The default behavior ensures that only one is running at a time, with +# all others queuing and thus not interrupting runs that are in-flight. +concurrency: ${{ github.workflow }} + +permissions: + contents: read + +jobs: + build: + uses: ./.github/workflows/build.yaml + + deploy: + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: app + path: "${{ github.workspace }}" + + - name: Setup Spin + uses: fermyon/actions/spin/setup@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Fermyon Cloud + run: spin cloud login --token "${{ secrets.FERMYON_CLOUD_TOKEN }}" + + - name: Deploy to Fermyon Cloud + uses: fermyon/actions/spin/deploy@v1 + with: + run_build: false + fermyon_token: "${{ secrets.FERMYON_CLOUD_TOKEN }}"