feat: create a separate devshell for CI purposes #39
Workflow file for this run
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: "Build and publish" | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
jobs: | ||
generate-documentation: | ||
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-") | ||
Check failure on line 11 in .github/workflows/build.yaml GitHub Actions / Build and publishInvalid workflow file
Check failure on line 11 in .github/workflows/build.yaml GitHub Actions / Build and publishInvalid workflow file
|
||
name: Generate and publish documentation | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pages: write | ||
packages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: nixbuild/nix-quick-install-action@v28 | ||
- name: Activate Nix cache | ||
uses: nix-community/cache-nix-action@v5 | ||
with: | ||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock', '**/Cargo.lock', '**/yarn.lock') }} | ||
restore-prefixes-first-match: nix-${{ runner.os }}- | ||
gc-max-store-size: 2684354560 # 2.5 GB | ||
- name: Build documentation | ||
run: nix build .#docs | ||
- name: Upload documentation artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./result/share/doc | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 | ||
build-and-publish: | ||
if: github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, "bump-") | ||
name: Build and publish ${{ matrix.package }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package: [cjs, esm] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: nixbuild/nix-quick-install-action@v28 | ||
- name: Activate Nix cache | ||
uses: nix-community/cache-nix-action@v5 | ||
with: | ||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock', '**/Cargo.lock', '**/yarn.lock') }} | ||
restore-prefixes-first-match: nix-${{ runner.os }}- | ||
gc-max-store-size: 2684354560 # 2.5 GB | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
registry-url: https://registry.npmjs.org | ||
- name: Build ${{ matrix.package }} package | ||
run: nix build .#${{ matrix.package }} | ||
- name: Publish ${{ matrix.package }} package | ||
run: npm publish --access public | ||
working-directory: ./result | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} |