Skip to content
This repository was archived by the owner on Sep 22, 2024. It is now read-only.
/ Github-Actions Public archive

Simple boilerplate of online shop with CI/CD

Notifications You must be signed in to change notification settings

ForwardMoth/Github-Actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github-Actions

Basic instructions with github actions

  1. Create yml file in .github/workflows directory

  2. Write in your yml file:

name: learn-github-actions
run-name: ${{ github.actor }} is learning GitHub Actions
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix: 
        node-version: [ 16.x ]

    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
      - name: install modules
        run: npm install
      - name: build project 
        run: npm run build  
  1. Setup ssh keys
ssh-keygen -m PEM -t rsa -b 4096 -C "your-name-github-secret"
  1. Copy private key in Github repository secrets variables with YOUR_NAME_SSH_PRIVATE_KEY

  2. Copy public key in .ssh/authorized_keys in your remote ssh server

  3. Write in yml file new job connected with ssh

  deploy:
    runs-on: ubuntu-latest
    needs: build 
    steps:
      - name: executing remote ssh server 
        uses: appleboy/ssh-action@master 
        with:
          host: ${{ secrets.HOST_NAME }}
          username: ${{ secrets.USER_NAME }}
          key: ${{ secrets.YOUR_NAME_SSH_PRIVATE_KEY }}
          port: ${{ secrets.PORT }}
          script: | 
            cd /path/to/your/app
            git pull origin main 
            git status
  1. Add new secrets variables secrets.HOST_NAME, secrets.USER_NAME, secrets.SSH_PRIVATE_KEY, secrets.PORT in your github repository

About

Simple boilerplate of online shop with CI/CD

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors