Skip to content

Instantly share code, notes, and snippets.

@rchaganti
Last active July 10, 2020 23:47
Embed
What would you like to do?
BlogSnippets
{{<armvisualize href="link-to-json-file">}}
{{<armvisualize "link-to-json-file">}}
{{<azcloudshell target="bash">}}
{{<azcloudshell target="powershell">}}
{{<azcloudshell>}}
{{ if .IsNamedParams }}
<a href="{{.Get "href"}}" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png" alt="">
</a>
<br />
{{ else }}
<a href="{{.Get 0}}" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png" alt="">
</a>
<br />
{{ end }}
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-storage-account-create%2Fazuredeploy.json" target="_blank">
<img src="https://aka.ms/deploytoazurebutton"/>
</a>
{{<azdeploy href="link-to-json">}}
{{<azdeploy "link-to-json">}}
{{ if .IsNamedParams }}
<center>
<iframe
src="{{.Get "src"}}/player"
width="640"
height="360"
frameBorder="0"
allowfullscreen="true">
</iframe>
</center>
<br />
{{ else }}
<center>
<iframe
src="{{.Get 0}}/player"
width="640"
height="360"
frameBorder="0"
allowfullscreen="true">
</iframe>
</center>
<br />
{{ end }}
{{<channel9 src="https://channel9.msdn.com/Events/Build/2020/KEY01">}}
{{<channel9 "https://channel9.msdn.com/Events/Build/2020/KEY01">}}
gh pr create --title "#GitHub Workflow For Streamlined Publishing of Static Pages #Hugo" --body "https://ravichaganti.com/blog/github-workflow-for-streamlined-publishing-of-static-pages"
gh pr merge --merge 10
{{< gist rchaganti 056a02f289d7d5415c17d27082ee753b "gistshortcode" >}}
<div class="views">
<span class="views">
<img src="https://visitor-badge.glitch.me/badge?page_id={{ .Permalink }}" alt="Views"/>
</span>
</div>
# Publishes a blog post when a pull request is merged.
name: Publish Blog Post
# Controls when the action will run. Triggers the workflow on closing a pull request
# events but only for the live branch
on:
pull_request:
branches: [ live ]
types: [closed]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: false
fetch-depth: 0
# setup Hugo 0.73.0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.73.0'
extended: true
# start the hugo static site generation.
- name: Build
run: hugo
# deploy the generated static pages to the external repo hosting the website
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.hugo_token }}
external_repository: rchaganti/rchaganti.github.io
user_name: 'Ravikanth C'
user_email: 'rxxx89x@rxxtysysy.com'
publish_branch: 'master'
cname: ravichaganti.com
# tweet the article
- name: Tweet
uses: ethomson/send-tweet-action@v1
with:
status: "${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}"
consumer-key: ${{ secrets.TWITTER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_API_SECRET_KEY }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment