<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>2022-01 on Funky Si's Test</title><link>https://blog-test.funkysi1701.com/2022/01/</link><description>Recent content in 2022-01 on Funky Si's Test</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>funkysi1701@gmail.com (Simon Foster)</managingEditor><webMaster>funkysi1701@gmail.com (Simon Foster)</webMaster><lastBuildDate>Tue, 25 Jan 2022 20:00:45 +0000</lastBuildDate><atom:link href="https://blog-test.funkysi1701.com/2022/01/index.xml" rel="self" type="application/rss+xml"/><item><title>Why developers need a personal site</title><link>https://blog-test.funkysi1701.com/posts/2022/why-do-i-have-a-website/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Tue, 25 Jan 2022 20:00:45 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2022/why-do-i-have-a-website/</guid><category term="Website">Website</category><media:content medium="image" type="image/jpeg" url="https://blog-test.funkysi1701.com/images/WHAT-IS-THE-CORPORATE-WEBSITE.jpg"/><description>&lt;p&gt;Is it to share my ideas? Is it to learn new technologies and techniques? Is it to create a following? Is it to educate others? Is it to build some kind of service? Is it some combination of all of these.&lt;/p&gt;
&lt;h2 id="history"&gt;History&lt;a class="anchor ms-1" href="#history" aria-label="Permalink: History"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Back when the web was young and I was first learning HTML. I hand crafted web pages, adding photos I had taken with captions. If I needed a new page I just added a new html page and linked to it from another page.&lt;/p&gt;
&lt;p&gt;As time went on I started to learn mysql and php and my website became a hand crafted php nightmare. I also applied what I learned to help my father run the website for his camera club.&lt;/p&gt;
&lt;p&gt;At some point I started playing with WordPress. I have had various WordPress websites or blogs over the years. WordPress is very powerful you can do so many things, install so many plugins. WordPress runs on php and mysql and as my career started to centre around the .net space, I started to want something that was similar, so I could apply things I had learnt to my own website.&lt;/p&gt;
&lt;p&gt;This has led me to the current state of my website. I have a WordPress blog, with most of my oldest content, my newer content lives on dev.to and I have a Blazor webassembly site that uses the dev.to api to run my new website.&lt;/p&gt;
&lt;p&gt;Blazor webassembly is great, however it has some limitations which I am starting to push against. To host this as cheaply as possible I am using Azure static web apps, so no .net backend all the website is front end. I have some Azure Functions that does the backend bits that I need.&lt;/p&gt;
&lt;p&gt;Google and other bots are not able to find any of my pages except index, due to the way Blazor works. I have got round this by pre rendering the content using &lt;a href="https://prerender.io/" target="_blank" rel="noopener noreferrer"&gt;https://prerender.io/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;My next difficulty is how to generate a sitemap.xml or a rss feed for my blog. This has started to make me question my architecture decisions.&lt;/p&gt;
&lt;p&gt;I could use a hosted solution like &lt;a href="https://ghost.org/" target="_blank" rel="noopener noreferrer"&gt;ghost&lt;/a&gt;
which is popular with a some of my peers. This would solve many of the problems I am currently facing but I wouldn&amp;rsquo;t be able to play with everything as it is hosted and therefore someone else&amp;rsquo;s problem. How important that is I will look at later.&lt;/p&gt;
&lt;p&gt;Another option would be to use github pages, there are quite a few ways to publish a github page, &lt;a href="https://jekyllrb.com/" target="_blank" rel="noopener noreferrer"&gt;Jekyll&lt;/a&gt;
and &lt;a href="https://gohugo.io/" target="_blank" rel="noopener noreferrer"&gt;Hugo&lt;/a&gt;
appear to be the most popular. Both produce static content and both are a new for me to learn. Interestingly I could also publish either to Azure Static Web apps if github pages ends up not being suitable.&lt;/p&gt;
&lt;h2 id="split-in-two"&gt;Split in two&lt;a class="anchor ms-1" href="#split-in-two" aria-label="Permalink: Split in two"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I think my website needs to be split in two. I need a stable blog platform probably using Hugo and github pages. This is what I want to get indexed by the search engines and be the primary way people find out about what I am doing.&lt;/p&gt;
&lt;p&gt;I then have additional sites, that I use as my playground for learning new tech. I can easily link between them and I can tweak the style so they &amp;ldquo;fit&amp;rdquo; nicely together.&lt;/p&gt;
&lt;p&gt;I am still considering what to do with dev.to. I like that I am using it as the backend for my blog posts, and its API gives me that flexibility to display that content where I want.&lt;/p&gt;</description></item><item><title>Using GitHub Actions</title><link>https://blog-test.funkysi1701.com/posts/2022/using-github-actions/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Mon, 10 Jan 2022 20:00:45 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2022/using-github-actions/</guid><category term="GitHub">GitHub</category><category term="DevOps">DevOps</category><media:content medium="image" type="image/png" url="https://blog-test.funkysi1701.com/images/2022/using-github-actions-banner.png"/><description>&lt;p&gt;I&amp;rsquo;ve been running my website on Azure Static Web Apps for a while and it is pretty cool.&lt;/p&gt;
&lt;p&gt;When you create a Static Web App on Azure you get asked for the github repo of your source code and even the branch to use.
&lt;img class="img-fluid" alt="GitHub Repo for my Static Web App" src="https://blog-test.funkysi1701.com/images/2022/static-web-app-github-repo.png" loading="lazy"
width="734" height="340"
/&gt;
&lt;/p&gt;
&lt;p&gt;Once you have selected this, you get asked for the type of code to deploy, mine is Blazor Web Assembly but you can use Angular, React or Vue.&lt;/p&gt;
&lt;p&gt;
&lt;img class="img-fluid" alt="GitHub Actions workflow creation" src="https://blog-test.funkysi1701.com/images/2022/github-actions-workflow-creation.png" loading="lazy"
width="730" height="321"
/&gt;
You now have three variables to fill in the location in your code of the Website, the location of your Azure Functions and the output location usually wwwroot. Once you have set these three you can preview the GitHub Actions file that will be created and added to your repository.&lt;/p&gt;
&lt;p&gt;I get something like this&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;name: Azure Static Web Apps CI/CD
on:
push:
branches:
- feature/tempbranch
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- feature/tempbranch
jobs:
build_and_deploy_job:
if: github.event_name == &amp;#39;push&amp;#39; || (github.event_name == &amp;#39;pull_request&amp;#39; &amp;amp;&amp;amp; github.event.action != &amp;#39;closed&amp;#39;)
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_&amp;lt;GENERATED_HOSTNAME&amp;gt; }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: &amp;#34;upload&amp;#34;
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: &amp;#34;Client&amp;#34; # App source code path
api_location: &amp;#34;Api&amp;#34; # Api source code path - optional
output_location: &amp;#34;wwwroot&amp;#34; # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == &amp;#39;pull_request&amp;#39; &amp;amp;&amp;amp; github.event.action == &amp;#39;closed&amp;#39;
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_&amp;lt;GENERATED_HOSTNAME&amp;gt; }}
action: &amp;#34;close&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This github action will run when you create a Pull Request to the branch mentioned in the file, or if you push code into the branch. This code get added into the .github/workflows/ folder and is the location that all github action workflows live.&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t done much with github actions, however I have used Azure DevOps quite a bit. Over on the Azure DevOps side I have created a pipeline that deploys to a Dev environment, then a Test environment and finally a production environment.&lt;/p&gt;
&lt;p&gt;Lets have a look at the workflow that I ended up with and with can break down how it all works. Note I am new to Github actions so if there is a better way of doing this do let me know.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;name: Azure Static Web Apps
on:
push:
branches:
- main
- develop
- feature/*
jobs:
dev:
runs-on: ubuntu-latest
environment:
name: Dev
name: Dev
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_&amp;lt;GENERATED_HOSTNAME&amp;gt; }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: &amp;#34;upload&amp;#34;
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: &amp;#34;Blog&amp;#34; # App source code path
api_location: &amp;#34;Blog.Func&amp;#34; # Api source code path - optional
output_location: &amp;#34;wwwroot&amp;#34; # Built app content directory - optional
###### End of Repository/Build Configurations ######
test:
if: github.ref == &amp;#39;refs/heads/develop&amp;#39;
runs-on: ubuntu-latest
environment:
name: Test
name: Test
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_&amp;lt;GENERATED_HOSTNAME&amp;gt; }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: &amp;#34;upload&amp;#34;
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: &amp;#34;Blog&amp;#34; # App source code path
api_location: &amp;#34;Blog.Func&amp;#34; # Api source code path - optional
output_location: &amp;#34;wwwroot&amp;#34; # Built app content directory - optional
###### End of Repository/Build Configurations ######
prod:
if: github.ref == &amp;#39;refs/heads/main&amp;#39;
runs-on: ubuntu-latest
environment:
name: Prod
name: Prod
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_&amp;lt;GENERATED_HOSTNAME&amp;gt; }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: &amp;#34;upload&amp;#34;
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: &amp;#34;Blog&amp;#34; # App source code path
api_location: &amp;#34;Blog.Func&amp;#34; # Api source code path - optional
output_location: &amp;#34;wwwroot&amp;#34; # Built app content directory - optional
###### End of Repository/Build Configurations ######
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first thing I did was create three Azure Static Web Apps, I am using the free tier so while this is tripling my costs it is all still free! Doing this created three github action workflow files, I deleted two and edited the third, but before I deleted them I made a note of the AZURE_STATIC_WEB_APPS_API_TOKEN. If you look in your settings -&amp;gt; secrets for your repo you will see secrets have been created, this is the secure token that github uses to update your static web app.&lt;/p&gt;
&lt;p&gt;While we are in settings we might as well look at environments. I created a Prod, Test and Dev environment that I was going to use in my github actions.&lt;/p&gt;
&lt;p&gt;Environments can have various rules setup on them.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Required reviewers - this is like an approver, a user specified here must approve for the workflow to be deployed&lt;/li&gt;
&lt;li&gt;Wait time - I didn&amp;rsquo;t use this, but it looks like a certain amount of time can be set to pause the deployment. (I assume to do some kind of manual check)&lt;/li&gt;
&lt;li&gt;Deployment Branch - specify what branch are allowed to be deployed to what environments. I specified develop, main and feature branches could be deployed to the Dev environment, develop and main could go on Test and main could go on Prod&lt;/li&gt;
&lt;li&gt;Environment secrets - I didn&amp;rsquo;t use this as my secrets were already created, however it looks like your secrets can be associated with a specific environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now that we have the static web apps setup and the environments lets look at the github action file.&lt;/p&gt;
&lt;p&gt;First of all I removed the PR stuff and just concentrated on pushes. I wanted my workflow to be.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Push to feature branch&lt;/li&gt;
&lt;li&gt;Deploys to Dev env&lt;/li&gt;
&lt;li&gt;PR feature branch to develop&lt;/li&gt;
&lt;li&gt;Once merged code gets pushed into develop&lt;/li&gt;
&lt;li&gt;Deploys to Test env&lt;/li&gt;
&lt;li&gt;PR develop to main&lt;/li&gt;
&lt;li&gt;Once merged code gets pushed into main&lt;/li&gt;
&lt;li&gt;Deploys to Prod env (after approval)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The approval on deploying to production I think is probably overkill, but I still have it setup like that for now.&lt;/p&gt;
&lt;p&gt;My gh action has three jobs defined as dev: test: and prod: they are all the same except they have the azure_static_web_apps_api_token that is correct for their environment.&lt;/p&gt;
&lt;p&gt;They also each have a environment defined eg&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;environment:
name: Prod
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Lastly Test and Prod have an if test setup, if the test is false the job won&amp;rsquo;t run. Importantly it won&amp;rsquo;t fail it just won&amp;rsquo;t run.&lt;/p&gt;
&lt;p&gt;For Prod this needs to only run on main branch so we have&lt;/p&gt;
&lt;p&gt;if: github.ref == &amp;lsquo;refs/heads/main&amp;rsquo;&lt;/p&gt;
&lt;p&gt;For Test this needs to only run on develop so&lt;/p&gt;
&lt;p&gt;if: github.ref == &amp;lsquo;refs/heads/develop&amp;rsquo;&lt;/p&gt;
&lt;p&gt;I could have a test for develop to only run on feature/* but I have allowed it to run every time.&lt;/p&gt;
&lt;p&gt;There is loads more you can do with github actions, but hopefully this gives you a taste of some of the things you can do. I currently have a mix of Azure DevOps and github actions so I will be working on getting github actions to do more.&lt;/p&gt;
&lt;h2 id="github-actions-cheat-sheet"&gt;GitHub Actions Cheat Sheet&lt;a class="anchor ms-1" href="#github-actions-cheat-sheet" aria-label="Permalink: GitHub Actions Cheat Sheet"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Want a quick-reference guide you can keep beside your keyboard? I&amp;rsquo;ve put together a one-page GitHub Actions cheat sheet covering workflow structure, triggers, runners, contexts, conditions, matrix builds, caching, artifacts, OIDC permissions, and the most common actions — all on a single A4 page.&lt;/p&gt;
&lt;div class="card mb-4 border-primary"&gt;
&lt;div class="card-body"&gt;
&lt;h3 class="card-title"&gt;GitHub Actions Cheat Sheet — PDF&lt;/h3&gt;
&lt;p class="card-text text-muted"&gt;A one-page A4 quick-reference covering workflow structure, triggers, runners, contexts, conditions, matrix builds, caching, artifacts, OIDC permissions, and the most-used actions.&lt;/p&gt;
&lt;div class="d-flex justify-content-between align-items-center mt-3"&gt;
&lt;span class="fs-4 fw-bold text-success"&gt;£2.99&lt;/span&gt;
&lt;a href="https://buy.stripe.com/8x200j5Exe6UgRB5Ne0Ny00" class="btn btn-primary btn-lg" target="_blank" rel="noopener noreferrer"&gt;
Buy Now &amp;rarr;
&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>2022 Goals</title><link>https://blog-test.funkysi1701.com/posts/2022/2022-goals/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Sat, 01 Jan 2022 00:00:00 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2022/2022-goals/</guid><category term="Goals">Goals</category><description>&lt;p&gt;Lets have a look at what my goals were for 2021. I had eight of them, lets look at them one by one.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Azure certification&lt;/strong&gt;. In May of this year I sat and passed the Azure Fundamentals exam. I am calling this goal as achieved.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mentoring&lt;/strong&gt;. I didn&amp;rsquo;t do anything about working with others or mentoring, so not sure I achieved this one. However I do now work in a development team and I have been reviewing others code and having my own reviewed. We have a junior developer and I am enjoying the opportunities I have to work with him and share my wisdom.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;F#&lt;/strong&gt;. I have done zero work with F# in 2021, so this one I didn&amp;rsquo;t achieve.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cosmos db/Mongo db&lt;/strong&gt;. I have worked with both of these technologies in 2021. I used Cosmos the most with my website, and storing data for it. I used Mongo/Atlas for auditing for a project I did for my previous job. I wouldn&amp;rsquo;t say I was expert in either of these, but I am starting to get a flavour of non SQL Server databases. I should also note that I am using mysql a lot in my latest job, so another non SQL Server technology that I get to use on a daily basis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Give a talk&lt;/strong&gt;. I said last year that maybe I would make baby steps towards doing this, and I have. In the interview for my new job I gave a short presentation (I thought it was bad, but others didn&amp;rsquo;t!) I also gave a short introduction to Blazor talk which went down well.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mandlebrot Generator&lt;/strong&gt;. Did nothing on this one as well. I may have googled the code but that is as far as I got.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pwned Pass Mobile App&lt;/strong&gt;. I got an increase in users in 2021 and hence it it still running and I still pay for the API key. I am still considering what to do with it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Time for me&lt;/strong&gt;. Achieved this one, had plenty of time for myself.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="not-a-bad-year-but-what-are-my-goals-for-2022"&gt;Not a bad year but what are my goals for 2022?&lt;a class="anchor ms-1" href="#not-a-bad-year-but-what-are-my-goals-for-2022" aria-label="Permalink: Not a bad year but what are my goals for 2022?"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Video&lt;/strong&gt;. I have just purchased a green screen, so my first goal is to learn how to use OBS, how to light myself properly without getting horrible reflections. I have the content for my first talk, the talk I gave at work about Blazor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Conference&lt;/strong&gt;. Attend an in person conference. I am booked to attend Scottish Summit, however it has been postponed due to COVID-19.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Blog More&lt;/strong&gt;. I have been neglecting writing blog posts a bit recently, so I want to do more.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Metrics&lt;/strong&gt;. I have been recording various metrics from twitter, github etc and I would like to expand this and make it a service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Profile Pic&lt;/strong&gt;. My profile pic is getting a bit old, so it would be nice to update the images I use online and improve my personal brand.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item></channel></rss>