feat: add previews to PRs #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Preview | |
on: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@v4 | |
- name: Magic Nix Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- name: Build Frontend | |
run: nix build .#fmo_frontend_default | |
- name: Comment PR | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GH_COMMENT_TOKEN}} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `🚀 Preview deployment is ready! View Preview` | |
}); | |
- uses: elsirion/sspd@v3 | |
with: | |
path: 'result' | |
preview_token: ${{ secrets.SSPD_API_TOKEN }} | |
preview_url: "preview.sirion.io" |