Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to Netlify #330

Merged
merged 67 commits into from Mar 9, 2020
Merged

Deploy to Netlify #330

merged 67 commits into from Mar 9, 2020

Conversation

garbas
Copy link
Member

@garbas garbas commented Mar 5, 2020

This PR:

  • uses Github Actions to build nixos-homepage
  • deploys to Netlify (either as preview or to "production" if you commit to master branch)
  • comments on PR or commit with a link to a preview the website
  • 301 redirects we configured for things that should be redirected (look at netlify.toml file)

I already went ahead and configured secrets needed for this to work in NixOS/nixos-homepage repository. Secrets that I configures are:

  • GH_TOKEN (to be able to create comments, only needs public:repo scopes)
  • NETLIFY_AUTH_TOKEN (to authenticate to Netlify)
  • NETLIFY_SITE_ID (to select the site to which to deploy to)

For now I generated github and netlify token from my own account. I wonder if we should create a separate accounts only for this (eg. nixos-homepage-bot on github and nixos-homepage-webmaster on netlify).

You can find preview links in the PR history.

/cc @samueldr @edolstra

edolstra and others added 30 commits June 18, 2019 17:51
You can get a NixOS homepage in a container by running

  $ nixos-container create homepage --flake nixos-homepage
Flake input changes:

* Added 'hydra': 'github:NixOS/hydra/be8eb9d00d6a3fcac520bc7dfd5740c0b3ade746'
* Added 'hydra/nix': 'github:NixOS/nix/4ad5826a182f8eeb4cbc61e27d2128b08050b0d4'
* Added 'hydra/nix/nixpkgs': 'github:edolstra/nixpkgs/43e283790fbe330b723ac44b584824cf6d85c1ee'
* Added 'hydra/nixpkgs': 'github:edolstra/nixpkgs/d959778e0934c4c93896d509a65de798909c7cdd'
* Added 'nix': 'github:NixOS/nix/4a4521f46253e87a06af9333381c050e983b3c2f'
* Added 'nix/nixpkgs': 'github:edolstra/nixpkgs/43e283790fbe330b723ac44b584824cf6d85c1ee'
* Added 'nixpkgsStable': 'github:edolstra/nixpkgs/581caef4f5d58573c96ab6e9dbf1160209372029'
* Added 'nixpkgsUnstable': 'github:NixOS/nixpkgs/82cbc6af3cbb77a07e1725554119e0fb032d7cf6'
@garbas garbas requested a review from edolstra March 5, 2020 13:31
with:
publish-dir: './build'
production-branch: 'master'
github-token: ${{ secrets.GH_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a default token you can use that is able to post comments on the pull request:

Suggested change
github-token: ${{ secrets.GH_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use that and it didn't work ... it got stuck at fetching the token i think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the branch pushed on a forked repo or the nixos-homepage repo?

garbas added a commit to garbas/nixos-org-configurations that referenced this pull request Mar 5, 2020
zimbatm pushed a commit to NixOS/infra that referenced this pull request Mar 6, 2020
@edolstra edolstra merged commit 767a50a into NixOS:master Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants