Skip to content

Commit

Permalink
Fixed typo, update filenames and new post.
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamLinux01 committed Jul 17, 2024
1 parent 393cd48 commit fffad61
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ draft = false

It's been a while since I posted anything on here and I have been meaning to write something. Well, that something is now!

I am finally getting the hang of github actions. So with this newfound knowledge, I have streamlined the way I can get my words into a file up to making the webserver host the new content.
I am finally getting the hang of github actions. So with this newfound knowledge, I have streamlined the way I can get my words into a file up to making the web server host the new content.

The short of it is this: I make a new `.md` file in my local git repo with the proper syntaxt so Hugo can generate the pages correctly. I git add and commit my change, push it to github and through the magic that is github actions, it plops the new webserver content on docker hub. From there, I pull the new image and restart the container. DONE!
The short of it is this: I make a new `.md` file in my local git repo with the proper syntax so Hugo can generate the pages correctly. I git add and commit my change, push it to github and through the magic that is github actions, it plops the new web server content on docker hub. From there, I pull the new image and restart the container. DONE!

It makes me happy to be able to simplify and automate these kinds of things. I will probably be talking more about the specifics later on through podcast form.

Expand Down
55 changes: 55 additions & 0 deletions content/blogs/2024-07-17_it-finally-makes-sense.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
+++
title = 'It finally makes sense'
date = 2024-07-17T11:47:00-04:00
draft = false
+++

I finally did something that I have been wanting to accomplish for at least five years.

I now have it where I can automatically create PDFs based on asciidoc files in a git repo, without having to have any software installed on any of my machines to do it. I have found both a docker image and a github action to run the docker container which allows me to compile the PDFs, then upload those PDFs as a github artifact that I can download by clicking on the finished action.

I have been managing my resume in a private github repo for a few years now and I really liked asciidoc, so I wrote it using that markup language. Putting the resume in a git repo has been very handy, as I can easily see any changes I have made over the years if I need to go back for whatever reason. I also like that I don't have to worry about losing the files or misplacing a version. It's all stored in one place that I can clone from and push back to.

My issue was that I want to be able to send PDFs instead of the plain markup files. I would have to process the conversion locally and would store a copy inside the repo next to the `.adoc` files. I wasn't a fan of doing that. Installing asciidoctor on the machine is not great and remembering the docker commands to do the processing was equally annoying to me. I could have created an extra document about the docker commands inside the repo, but for some reason I didn't think about that until now.

Now that I have started to learn Github actions, I found what I needed to do to get my idea working. So I found that I needed a few things.

1. Docker image that could process asciidoc.
2. Github action to run docker images.
3. Github action to upload files.

For the docker image, I found that [asciidoctor](https://hub.docker.com/r/asciidoctor/docker-asciidoctor) would do the trick. Next was the Github action for running docker images, which I found [addnab/docker-run-action](https://github.com/marketplace/actions/docker-run-action) over on Github. Finally, the upload action is found at [actions/upload-artifact](https://github.com/marketplace/actions/upload-a-build-artifact).

With all that, I created `.github/workflows/Compile PDFs.yml` in my main branch.

```
name: Output PDFs
on:
push:
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run AsciiDoctor container to output PDFs
uses: addnab/docker-run-action@v3
with:
registry: docker.io
image: asciidoctor/docker-asciidoctor:latest
options: -v ${{ github.workspace }}:/documents
run: |
asciidoctor-pdf *.adoc
-
name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PDFs
path: ./*.pdf
```

I am very happy with results so far and will continue to refine as I go. So glad to share this with you all. Take care and God Bless.

0 comments on commit fffad61

Please sign in to comment.