Update the deployment section in the README file #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build the main branch and deploy it to habra-adm.ru | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
deployments: write | |
concurrency: | |
group: deployment | |
cancel-in-progress: false | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: habra-adm.ru | |
url: https://habra-adm.ru | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- run: npm ci | |
- run: npm run build | |
env: | |
NODE_ENV: production | |
- name: Deploy to habra-adm.ru | |
run: | | |
mkdir ~/.ssh | |
echo "${{ vars.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
eval `ssh-agent` | |
echo "$SSH_PRIVATE_KEY" | ssh-add - | |
rsync --recursive --verbose dist/ [email protected]:/var/www/habra-adm.ru | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Check if the URL is accessible | |
run: curl --fail https://habra-adm.ru |