Github Actions quick note

5/8/2025, 12:20:18 PM

edit test 1

CI/CD
my simplest CI/CD in github for my web project

we want to build the website on every commit

  • create ./.github/workflows/deploy.yaml in your project

  • create a bash script to run re-build commands

  • getting github ready:

    • generate ssh key:
      1. get to the parent file of where you pull the repo
      1. generate key using ssh-keygen -t rsa -b 4096 -C "ci-cd@github"
      1. cat id_rsa_github.pub >> ~/.ssh/authorized_keys
      1. 704 chmod 700 ~/.ssh
        • 705 chmod 600 ~/.ssh/authorized_keys
    • your repo in github → Settings → Secrets and variables → Actions
      • VPS_USER: VPS user
      • VPS_HOST: ssh ip
      • VPS_SSH_KEY: generated ssh key(not .pub)
    • also add your user to sudoers:
      1. sudo visudo
      1. add kali ALL=(ALL) NOPASSWD: /usr/bin/docker, /usr/bin/git