-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 9ae5d51 🚀
- Loading branch information
Showing
16 changed files
with
120 additions
and
0 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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"><title>tnmgl.de</title><link href="https://tmaegel.github.io/blog-website/" rel="alternate"></link><link href="https://tmaegel.github.io/blog-website/feeds/all.atom.xml" rel="self"></link><id>https://tmaegel.github.io/blog-website/</id><updated>2023-11-03T09:49:00+01:00</updated><entry><title>Deploy a Pelican site with GitHub Actions to GitHub Pages</title><link href="https://tmaegel.github.io/blog-website/deploy-pelican-site-with-github-actions-to-github-pages.html" rel="alternate"></link><published>2023-11-03T09:49:00+01:00</published><updated>2023-11-03T09:49:00+01:00</updated><author><name>Toni Mägel</name></author><id>tag:tmaegel.github.io,2023-11-03:/blog-website/deploy-pelican-site-with-github-actions-to-github-pages.html</id><summary type="html"><p>This blog is powered by <a href="https://getpelican.com/">Pelian</a>. It is a static site generator that requires no database or server-side logic and generates your website based on the content which is written in <code>reStructuredText</code> or <code>Markdown</code>.</p> | ||
<p>I host this site with GitHub Pages. So I though its the best choice to automatically …</p></summary><content type="html"><p>This blog is powered by <a href="https://getpelican.com/">Pelian</a>. It is a static site generator that requires no database or server-side logic and generates your website based on the content which is written in <code>reStructuredText</code> or <code>Markdown</code>.</p> | ||
<p>I host this site with GitHub Pages. So I though its the best choice to automatically deploy my changes (e.g. content or theme/template) and update my site as well on GitHub Pages by using GitHub Actions.</p> | ||
<p>My deployment workflow based on the following GitHub Actions:</p> | ||
<ul> | ||
<li><a href="https://github.com/actions/checkout">actions/checkout</a></li> | ||
<li><a href="https://github.com/actions/setup-python">actions/setup-python</a></li> | ||
<li><a href="https://github.com/JamesIves/github-pages-deploy-action">JamesIves/github-pages-deploy-action</a></li> | ||
</ul> | ||
<p>In the first step I checkout my GitHub repository with <code>actions/checkout</code> which holds my content and theme data of this site. Afterwards I prepare the python environment to install the needed python dependencies (e.g. <code>pelican</code>) to build my site based on the content and the templates. Finally I use the Github action <code>JamesIves/github-pages-deploy-action</code> to deploy the build results to GitHub Pages. This Actions takes the build results of <code>pelican</code>. In my case from the directory <code>build</code> and commit/push these to the corresponding branch (e.g. <code>gh-pages</code>).</p> | ||
<p>This results in the following GitHub Actions workflow.</p> | ||
<div class="highlight"><pre> | ||
<code> | ||
<span class="code-line"><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Deployment</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="nt">env</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">PELICAN_CONTENT_DIR</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">content</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">PELICAN_BUILD_DIR</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">build</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">PELICAN_CONFIG_FILE</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pelicanconf.py</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="nt">on</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">push</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">branches</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">main</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="nt">permissions</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">contents</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">write</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="nt">jobs</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">build</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">concurrency</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ci-${{ github.ref }}</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">runs-on</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ubuntu-latest</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">steps</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Checkout</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">actions/checkout@v4</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Setup python</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">actions/setup-python@v4</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">with</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">python-version</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;3.11&quot;</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Install dependencies</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">|</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="no">pip install --upgrade pip</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="no">pip install -r requirements.txt</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Build with pelican</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pelican $PELICAN_CONTENT_DIR -o $PELICAN_BUILD_DIR -s $PELICAN_CONFIG_FILE</span></span> | ||
<span class="code-line"></span> | ||
<span class="code-line"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Deploy</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">JamesIves/github-pages-deploy-action@v4</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">with</span><span class="p">:</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">folder</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">${{ env.PELICAN_BUILD_DIR }}</span></span> | ||
<span class="code-line"><span class="w"> </span><span class="nt">branch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">gh-pages</span></span> | ||
</code> | ||
</pre></div></content><category term="DevOps"></category><category term="Pelican"></category><category term="GitHub"></category><category term="GithubActions"></category><category term="GitHubPages"></category></entry></feed> |
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
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
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
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
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
Oops, something went wrong.