From fffad61a129d0e6a12deacef6bc05c6465e0591c Mon Sep 17 00:00:00 2001 From: TeamLinux01 <43735175+TeamLinux01@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:16:42 -0400 Subject: [PATCH] Fixed typo, update filenames and new post. --- ...=> 2024-07-16_getting-back-into-things.md} | 4 +- .../2024-07-17_it-finally-makes-sense.md | 55 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) rename content/blogs/{getting-back-into-things.md => 2024-07-16_getting-back-into-things.md} (73%) create mode 100644 content/blogs/2024-07-17_it-finally-makes-sense.md diff --git a/content/blogs/getting-back-into-things.md b/content/blogs/2024-07-16_getting-back-into-things.md similarity index 73% rename from content/blogs/getting-back-into-things.md rename to content/blogs/2024-07-16_getting-back-into-things.md index 9fefbd7..96d1660 100644 --- a/content/blogs/getting-back-into-things.md +++ b/content/blogs/2024-07-16_getting-back-into-things.md @@ -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. diff --git a/content/blogs/2024-07-17_it-finally-makes-sense.md b/content/blogs/2024-07-17_it-finally-makes-sense.md new file mode 100644 index 0000000..2e28e44 --- /dev/null +++ b/content/blogs/2024-07-17_it-finally-makes-sense.md @@ -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. \ No newline at end of file