Denis Blog

DEFINING TOKEN DEPLOY AND VARIABLES ON GITHUB

Guide to define Token Deploy and Environments Variable on GitHub for to VPS

Steps

You must have an account on Github
You must create a repository where the project will be hosted
Once inside Github, go to the top right where your user image is located and select it, below I show you a detailed list of the steps to follow:
  1. Settings
  2. Developer settings
  3. Personal access tokens
  4. Tokens (classic)
  5. Generate new token
  6. Generate new token (classic)
  7. To specific the name of token Example: TOKEN_DEPLOY
  8. Select the expiration
  9. Select box workflow
  10. Select box write:packages
  11. Press button Generate token
  12. Copy token generated Example: ghp_ffs61bz87J7mX1uSH3iFAGSNfYq5Z2143hYD
  13. You go to your project repository Example: https://github.com/username-on-github/name-repository
  14. Settings
  15. Secrets and variables
  16. Actions
  17. New repository secret
  18. On Name you must put the name of token: TOKEN_DEPLOY
  19. On Secret the value of token: ghp_ffs61bz87J7mX1uSH3iFAGSNfYq5Z2143hYD
  20. Also you can add others variables like: HOST_VPS, PASSWORD_VPS, PORT_VPS, USERNAME_VPS
  21. Now you can make push on branch
  22. Execute command: git add .
  23. Then the command: git commit -m "name of commit"
  24. Finally: git push origin [the branch you specified on deploy.yml file]
Copyright © Blog-Denis 2024