Files
yet-another-cad-viewer/.github/workflows/deploy.yml
2024-03-03 19:45:53 +01:00

50 lines
1.5 KiB
YAML

name: "Deploy"
on:
workflow_run:
workflows: [ "Continuous Integration" ]
types: [ "completed" ]
branches: [ "master" ]
permissions:
contents: "write"
jobs:
check-early-exit:
runs-on: "ubuntu-latest"
outputs:
should-deploy: "${{ steps.check-early-exit.outputs.should-deploy }}"
steps:
- run: "echo ${{ github.ref }}"
- run: "echo ${{ github.ref }} | grep -q -v -E '^refs/tags/v[0-9]+\\.[0-9]+\\.[0-9]+' && echo '::set-output name=should-deploy::false' || echo '::set-output name=should-deploy::true'"
deploy:
concurrency: "ci-${{ github.ref }}" # Recommended if you intend to make multiple deployments in quick succession.
runs-on: "ubuntu-latest"
needs: "check-early-exit"
if: "needs.check-early-exit.outputs.should-deploy == 'true'"
steps:
- uses: "dawidd6/action-download-artifact@v3"
with:
workflow: "ci.yml"
name: "frontend"
path: "./public"
- uses: "dawidd6/action-download-artifact@v3"
with:
workflow: "ci.yml"
name: "logo"
path: "./public"
- run: "ls -l -R ./public"
- uses: "JamesIves/github-pages-deploy-action@v4"
with:
folder: "public"
- uses: "svenstaro/upload-release-action@v2"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
file: "./public/*"
asset_name: "frontend"
tag: "${{ github.ref }}"
overwrite: true
file_glob: true