-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
13 additions
and
70 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: demo | |
on: | ||
push: | ||
branches: | ||
- state-refactor | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,25 @@ | ||
name: publish | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
install: | ||
name: Installs and configures nix | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkouts code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Sets up Node for registry only | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.17' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Caches Nix store | ||
uses: actions/cache@v3 | ||
id: nix-cache | ||
with: | ||
path: /tmp/nix-cache | ||
key: nix-${{ hashFiles('**/flake.*') }} | ||
|
||
- name: Caches Node modules | ||
uses: actions/cache@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v4 | ||
with: | ||
path: '**/node_modules' | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Installs Nix | ||
uses: cachix/install-nix-action@v22 | ||
path: node_modules | ||
key: yarn-${{ hashFiles('yarn.lock') }} | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-23.05 | ||
extra_nix_config: | | ||
experimental-features = nix-command flakes | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- name: Imports Nix store cache | ||
if: ${{ steps.nix-cache.outputs.cache-hit == 'true' }} | ||
run: nix-store --import < /tmp/nix-cache | ||
|
||
- name: Installs deps | ||
run: nix develop -c yarn install --frozen-lockfile --immutable | ||
|
||
- name: Exports Nix store cache | ||
if: ${{ steps.nix-cache.outputs.cache-hit != 'true' }} | ||
run: nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nix-cache | ||
|
||
- name: Builds lib | ||
working-directory: lib | ||
run: nix develop -c yarn build | ||
|
||
- name: Copies README to the lib folder | ||
run: cp README.md LICENSE lib/ | ||
|
||
- name: Publishes the lib | ||
working-directory: lib | ||
run: | | ||
nix develop --impure | ||
yarn publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Builds the demo | ||
working-directory: demo | ||
run: nix develop -c yarn build | ||
nix_path: nixpkgs=channel:nixos-24.11 | ||
enable_kvm: true | ||
- run: nix-shell --run 'yarn install --frozen-lockfile --immutable' | ||
- run: nix-shell --run 'yarn build' | ||
- run: nix-shell --run 'yarn publish --access public' | ||
env: | ||
PUBLIC_URL: /react-pin-field | ||
|
||
- name: Deploys the demo | ||
uses: jamesives/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: demo/build | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |