From f642e77bcd0e8ff8f41bc2435f10e79359e11b1b Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Wed, 12 Apr 2023 12:23:43 +0900 Subject: [PATCH] mirror `beacon-apis` deploy flow (#75) --- .github/workflows/deploy.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 34f66e9..81aa509 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,6 +6,31 @@ on: - "main" jobs: + outputs: + releases: ${{ steps.releases.outputs.releases }} + steps: + - id: releases + run: | + echo "releases=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{github.repository}}/releases?per_page=100" | jq -c '[.[].tag_name]')" >> $GITHUB_OUTPUT + releases: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + release: ${{fromJson(needs.setup.outputs.releases)}} + steps: + - uses: dsaltares/fetch-gh-release-asset@1.1.0 + with: + version: 'tags/${{ matrix.release }}' + file: 'builder-oapi.json' + target: 'deploy/releases/${{ matrix.release }}/builder-oapi.json' + - name: Save releases (artifact) + uses: actions/upload-artifact@v3 + with: + name: releases + retention-days: 7 + path: | + deploy/releases deploy: runs-on: ubuntu-latest steps: @@ -20,6 +45,11 @@ jobs: cp -r dist ./deploy cp -r assets ./deploy cp -r index.html ./deploy + - name: Restore releases + uses: actions/download-artifact@v3 + with: + name: releases + path: deploy/releases - name: Bundle spec run: "swagger-cli bundle ./builder-oapi.yaml -r -t yaml -o ./deploy/builder-oapi.yaml" - name: Publish to Github Pages