Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
deploy to netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed Apr 10, 2020
1 parent bbf2597 commit 4a0abe0
Show file tree
Hide file tree
Showing 22 changed files with 877 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cron.yml
@@ -0,0 +1,26 @@
name: "Hourly Build & Deploy to Netlify"
on:
schedule:
- cron: '0 * * * *'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Installing Nix
uses: cachix/install-nix-action@v8
- name: Building planet.nixos.org
run: nix-shell -p venus --command "venus-planet planet.ini"
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.0.5
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
publish-dir: './dist'
production-branch: 'master'
deploy-message: 'Deploy from GitHub Actions'
if: github.repository == 'NixOS/nixos-planet'
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,30 @@
name: "Build & Deploy to Netlify"
on:
pull_request:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checking out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Installing Nix
uses: cachix/install-nix-action@v8
- name: Building nixos.org
- name: Building nixos.org/planet
run: nix-shell -p venus --command "venus-planet planet.ini"
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.0.5
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
publish-dir: './dist'
production-branch: 'master'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy from GitHub Actions'
if: github.repository == 'NixOS/nixos-planet'
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/cache/
/dist/
/theme/*.tmplc
97 changes: 97 additions & 0 deletions planet.ini
@@ -0,0 +1,97 @@
[Planet]
name = NixOS Planet
link = https://nixos.org/planet
owner_name = Rok Garbas
owner_email = rok@garbas.si
output_theme = ./theme
output_dir = ./dist
cache_directory = ./cache
items_per_page = 15

[https://blog.matejc.com/matejc-nixos/RSS/]
name = Matej Cotman
link = http://blog.matejc.com

[https://compiletoi.net/tag/nixos/rss/]
name = Georges Dubus
link = http://compiletoi.net/

[https://garbas.si/feeds/tag-nixos.atom.xml]
name = Rok Garbas
link = https://garbas.si

[https://www.domenkozar.com/category/nixos/feed/atom/index.xml]
name = Domen Kozar
link = https://www.domenkozar.com/

[http://sandervanderburg.blogspot.com/feeds/posts/default/-/Nix?alt=rss]
name = Sander van der Burg
link = http://sandervanderburg.blogspot.com

[https://lastlog.de/blog/feed.xml]
name = Joachim Schiele
link = http://lastlog.de/blog

[http://nixer.ghost.io/rss/]
name = Rob Vermaas
link = http://nixer.ghost.io

[http://lethalman.blogspot.com/feeds/posts/default/-/nix]
name = Luca Bruno
link = http://lethalman.blogspot.com

[https://reflexivereflection.com/tags/nixos.xml]
name = Anders Papitto
link = https://reflexivereflection.com

[https://blog.flyingcircus.io/tag/nixos/feed/]
name = Flying Circus
link = https://blog.flyingcircus.io/tag/nixos/

[https://ocharles.org.uk/blog/posts.rss]
name = Ollie Charles
link = https://ocharles.org.uk/blog

[https://edwtjo.me/tags/NixOS/atom.xml]
name = Edward Tjörnhammar
link = http://edwtjo.me/tags/NixOS/

[https://sheenobu.net/categories/nixos/index.xml]
name = Sheena Artrip
link = https://sheenobu.net

[https://www.meetup.com/Munich-NixOS-Meetup/events/rss/]
name = Munich NixOS Meetup
link = https://www.meetup.com/Munich-NixOS-Meetup/

[https://typing-nix.regnat.ovh/index.rss]
name = Typing nix
link = https://typing-nix.regnat.ovh/

[https://matthewbauer.us/blog/feed.xml]
name = Matthew Bauer
link = https://matthewbauer.us/blog/

[https://grahamc.com/feed/nix.xml]
name = Graham Christensen
link = https://grahamc.com/

[https://nixos.mayflower.consulting/blog/index.xml]
name = Mayflower
link = https://nixos.mayflower.consulting/

[https://blog.hercules-ci.com/feed.xml]
name = Hercules Labs
link = https://blog.hercules-ci.com/

[https://mcwhirter.com.au/tags/NixOS/index.atom]
name = Craige McWhirter
link = https://mcwhirter.com.au/

[https://blog.cachix.org/index.xml]
name = Cachix
link = https://www.cachix.org

[https://blog.nixbuild.net/index.xml]
name = nixbuild.net
link = https://blog.nixbuild.net
41 changes: 41 additions & 0 deletions theme/admin.html.tmpl
@@ -0,0 +1,41 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><TMPL_VAR name> administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="<TMPL_VAR generator ESCAPE="HTML">">
</head>

<body>
<h2>Maintenance tasks</h2>
<form action="admin_cb.py" method="GET">
<input type="hidden" name="command" value="refresh" />
<input type="submit" value="Refresh planet" />
</form><br />
<form action="admin_cb.py" method="GET">
<input type="hidden" name="command" value="run" />
<input type="submit" value="Run planet" />
</form><br />
<form action="admin_cb.py" method="GET">
<input type="hidden" name="command" value="expunge" />
<input type="submit" value="Expunge planet" />
</form>

<h2>Blacklist</h2>
<div>
<form action="admin_cb.py" method="GET">
<input type="hidden" name="command" value="blacklist" />
<TMPL_LOOP Items>
<input type="checkbox" value="<TMPL_VAR id ESCAPE="HTML">" name="bl<TMPL_VAR __PASS__>">
<a target="_blank" href="<TMPL_VAR channel_link ESCAPE="HTML">">
<TMPL_VAR channel_name>
</a>: <a target="_blank" href="<TMPL_VAR link ESCAPE="HTML">"><TMPL_VAR title></a></input>
<br />
</TMPL_LOOP>
<br />
<input type="submit" value="Blacklist" />
</form>
</div>
</body>

</html>
80 changes: 80 additions & 0 deletions theme/atom.xml.xslt
@@ -0,0 +1,80 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:access="http://www.bloglines.com/about/specs/fac-1.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:indexing="urn:atom-extension:indexing"
xmlns:planet="http://planet.intertwingly.net/"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="planet xhtml">

<!-- strip planet elements and attributes -->
<xsl:template match="planet:*|@planet:*"/>

<!-- strip obsolete link relationships -->
<xsl:template match="atom:link[@rel='service.edit']"/>
<xsl:template match="atom:link[@rel='service.post']"/>
<xsl:template match="atom:link[@rel='service.feed']"/>

<!-- Feedburner detritus -->
<xsl:template match="xhtml:div[@class='feedflare']"/>

<!-- Strip site meter -->
<xsl:template match="xhtml:div[comment()[. = ' Site Meter ']]"/>

<!-- add Google/LiveJournal-esque and Bloglines noindex directive -->
<xsl:template match="atom:feed">
<xsl:copy>
<xsl:attribute name="indexing:index">no</xsl:attribute>
<xsl:apply-templates select="@*"/>
<access:restriction relationship="deny"/>
<xsl:apply-templates select="node()"/>
<xsl:text>&#10;</xsl:text>
</xsl:copy>
</xsl:template>

<!-- popular customization: add planet name to each entry title
<xsl:template match="atom:entry/atom:title">
<xsl:text>&#10; </xsl:text>
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:value-of select="../atom:source/planet:name"/>
<xsl:text>: </xsl:text>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
-->

<!-- indent atom elements -->
<xsl:template match="atom:*">
<!-- double space before atom:entries -->
<xsl:if test="self::atom:entry">
<xsl:text>&#10;</xsl:text>
</xsl:if>

<!-- indent start tag -->
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="ancestor::*">
<xsl:text> </xsl:text>
</xsl:for-each>

<xsl:copy>
<xsl:apply-templates select="@*|node()"/>

<!-- indent end tag if there are element children -->
<xsl:if test="*">
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="ancestor::*">
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:if>
</xsl:copy>
</xsl:template>

<!-- pass through everything else -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
16 changes: 16 additions & 0 deletions theme/config.ini
@@ -0,0 +1,16 @@
# This theme reimplements the classic "fancy" htmltmpl using genshi

[Planet]
template_files:
atom.xml.xslt
foafroll.xml.xslt
index.html.tmpl
opml.xml.xslt
rss10.xml.tmpl
rss20.xml.tmpl

bill_of_materials:
planet.css
images/feed-icon-10x10.png
images/logo.png
images/planet.png
39 changes: 39 additions & 0 deletions theme/foafroll.xml.xslt
@@ -0,0 +1,39 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:rss="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:planet="http://planet.intertwingly.net/"
exclude-result-prefixes="atom planet">

<xsl:output indent="yes" method="xml"/>

<xsl:template match="atom:feed">
<rdf:RDF>
<foaf:Group>
<foaf:name><xsl:value-of select="atom:author/atom:name"/></foaf:name>
<foaf:homepage><xsl:value-of select="atom:author/atom:uri"/></foaf:homepage>

<xsl:apply-templates select="planet:source"/>
</foaf:Group>
</rdf:RDF>
</xsl:template>

<xsl:template match="planet:source">
<foaf:member>
<foaf:Agent>
<foaf:name><xsl:value-of select="planet:name"/></foaf:name>
<foaf:weblog>
<foaf:Document rdf:about="{atom:link[@rel='alternate']/@href}">
<dc:title><xsl:value-of select="atom:title"/></dc:title>
<rdfs:seeAlso>
<rss:channel rdf:about="{atom:link[@rel='self']/@href}" />
</rdfs:seeAlso>
</foaf:Document>
</foaf:weblog>
</foaf:Agent>
</foaf:member>
</xsl:template>
</xsl:stylesheet>
Binary file added theme/images/feed-icon-10x10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/foaf.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/opml.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/planet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/tcosm11.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/images/venus.ico
Binary file not shown.
Binary file added theme/images/venus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a0abe0

Please sign in to comment.