/templates

Github templates for various programming languages I use often

Templates

Templates repositories to use as base for repositories. These are shown above as Git submodules and can be accessed by clicking on them.

It also contains some other useful information irrelevant to templates.

Content

Github steps

  1. Create the repository on Github picking the template you want.

  2. Set secrets in https://github.com/qdm12/REPONAME_GITHUB/settings/secrets

    • DOCKERHUB_PASSWORD
    • PHONITO_TOKEN (if final Docker image is not based on Scratch)
  3. Git clone the repository with:

    git clone git@github:qdm12/REPONAME_GITHUB.git
    cd REPONAME_GITHUB
  4. Replace REPONAME_GITHUB, REPONAME_DOCKER and SHORT_DESCRIPTION:

    find ./ -type f -exec sed -i 's/REPONAME_DOCKER/realname/g' {} +
    find ./ -type f -exec sed -i 's/REPONAME_GITHUB/realname/g' {} +
    find ./ -type f -exec sed -i 's/SHORT_DESCRIPTION/realdescription/g' {} +
  5. Work on the code and documentation, make sure:

    • Use $(pwd) for bind mounts with docker run commands
    • The container runs without root with USER 1000 or libcap or gosu
    • Check the container can be restarted without permission issues
    • A healthcheck endpoint and Docker is implemented if possible
  6. Upload your changes

    git add . && git commit -m "Initial commit" && git push
  7. Go to the Github repository github.com/qdm12/REPONAME_GITHUB webpage

    1. Add topics
    2. Set the website to hub.docker.com/r/qmcgaw/REPONAME_DOCKER
    3. Check README.md formatting
    4. Set the social preview at https://github.com/qdm12/REPONAME_GITHUB/settings
  8. Check the workflows at https://github.com/qdm12/REPONAME_GITHUB/actions

  9. Go to microbadger.com/images/qmcgaw/REPONAME_DOCKER

    1. Get the webhook link

    2. Replace the webhook link in .github/workflows/build-*.yml with:

      sed -i 's/WEBHOOK_LINK/realwebhook/g' .github/workflows/build-*.yml
  10. Upload the changes

    git add . && git commit -m "Formatting fixes and microbadger link" && git push

Other

TODO

  • Add github issues/PR templates
  • Other github special files
  • React components libary template using Storybook