Git Programming Tutorials, Guides & Best Practices
Explore 4+ expertly crafted git tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.
Adblocker Detected
It looks like you're using an adblocker. Our website relies on ads to keep running. Please consider disabling your adblocker to support us and access the content.
Github Ci GitHub workflows GitHub Actions CI/CD automation continuous integration continuous deployment GitHub CD GitHub Actions tutorial GitHub workflow YAML GitHub Actions examples automate GitHub matrix builds GitHub GitHub scheduled workflows deploying with GitHub Actions GitHub Actions best practices
Tutorial
Mastering GitHub Workflows for Continuous Integration and Deployment
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to server
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
ssh-agent bash -c 'ssh-add <(echo "$SSH_PRIVATE_KEY") && ssh -o StrictHostKeyChecking=no user@server "cd /path/to/app && git pull && npm install && pm2 restart all"'on: push: Triggers the workflow when there’s a push to themainbranch.secrets.SSH_PRIVATE_KEY: Retrieves the SSH key stored in GitHub Secrets, ensuring secure deployment.
Aug 29, 2024
Read More