Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-common-styles
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: babdda6bf216
Choose a base ref
...
head repository: NixOS/nixos-common-styles
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 49100052b6f2
Choose a head ref
  • 1 commit
  • 15 files changed
  • 1 contributor

Commits on Dec 17, 2020

  1. Copy the full SHA
    4910005 View commit details
59 changes: 59 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Build StoryBook & Deploy to Netlify"
on:
pull_request:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Installing Nix
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Install unstable channel
run: |
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
- name: Installing NixFlakes
run: |
nix-env -iA nixpkgs.nixFlakes
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
nix --version
cat /etc/nix/nix.conf
PATH="$HOME/.nix-profile/bin:$PATH"
echo "PATH=${PATH}" >> $GITHUB_ENV
- uses: cachix/cachix-action@v8
with:
name: nixos-homepage
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Building nixos.org
run: |
nix develop ./#packages.x86_64-linux.storyBook --command yarn run build-storybook
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
production-branch: 'main'
publish-dir: './storybook-static'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: true
enable-commit-comment: true
enable-commit-status: true
overwrites-pull-request-comment: false
if: github.repository == 'NixOS/nixos-common-styles'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/result*
/.cache/
/node_modules
/storybook-static/
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
10 changes: 9 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
in rec {

lib.memoizeAssets = assets:
pkgs.runCommandNoCC "nixos-site-svg-assets" {
pkgs.runCommandNoCC "nixos-styles-svg-assets" {
nativeBuildInputs = with pkgs.nodePackages; [
svgo
];
@@ -93,8 +93,16 @@
"@storybook/html"
];
postInstall = ''
# XXX: this is a hacky way to get things working
# we need to upstream this fixes
# node_modules is ready only
sed -i -e "s|node_modules/.cache/storybook|.cache/storybook|" \
$out/libexec/${package.name}/node_modules/@storybook/core/dist/server/utils/resolve-path-in-sb-cache.js
# copied favicon.ico is not writable
sed -i -e 's|await (0, _cpy.default)(defaultFavIcon, outputDir);|await (0, _cpy.default)(defaultFavIcon, outputDir);_fsExtra.default.chmod(_path.default.join(outputDir, _path.default.basename(defaultFavIcon)), 0o200);|' \
$out/libexec/${package.name}/node_modules/@storybook/core/dist/server/build-static.js
'';
};

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nixos-site-styles",
"name": "nixos-common-styles",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
@@ -14,6 +14,6 @@
},
"scripts": {
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"build-storybook": "build-storybook --quiet --docs"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.