brew install git
git config --global user.name "ВашеИмя"
git config --global user.email "вашапочта@example.com"
git config --list
mkdir my-project
cd my-project
git init
echo "My Project" >> README.md
git add README.md
git commit -m "Initial commit"
git remote add origin <repository_url>
git push -u origin master
git init
git clone <repository_url>
git add <file>
git commit -m "Commit message"
git status
git log
git push
git pull
git branch <branch_name>
git checkout <branch_name>
git checkout -b <branch_name>
git merge <branch_name>
git branch -d <branch_name>
name: CI Pipeline
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
stages:
- test
test_job:
stage: test
script:
- echo "Running tests"
- npm install
- npm test
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy to server
run: |
ssh user@server "cd /path/to/project && git pull origin main"
#!/bin/bash
cd /path/to/project
git pull origin main
"scripts": {
"release": "git tag v1.0.0 && git push origin --tags"
}
npm run release