Skip to content

Commit

Permalink
add key file
Browse files Browse the repository at this point in the history
  • Loading branch information
sushildeep committed Dec 12, 2023
1 parent d623d1e commit 7a8ad2e
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/doc.nuxeo.com.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ jobs:

environment:
name: ${{ github.ref == 'refs/heads/master' && 'production' || github.ref == 'refs/heads/development' && 'development' || '' }}

build-and-deploy:

steps:
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -23,6 +27,11 @@ jobs:
with:
node-version: '14'

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}

- name: Check Versions and Save to File
run: |
echo "git $(git --version)" > runtime-versions.txt
Expand All @@ -42,18 +51,16 @@ jobs:
echo > redirects_pageid.txt
- name: Deploy to Server
with:
SERVER_SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}
run: |
rsync -Waxvuk --delete site/ ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/opt/www/doc/
sync redirects.txt ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects.txt
rsync redirects_pageid.txt ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects_pageid.txt
rsync -Wxvuk --delete -e "ssh -i ${{ secrets.SERVER_SSH_PRIVATE_KEY }}" site/ "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/opt/www/doc/"
rsync -e "ssh -i ${{ secrets.SERVER_SSH_PRIVATE_KEY }}" redirects.txt "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects.txt"
rsync -e "ssh -i ${{ secrets.SERVER_SSH_PRIVATE_KEY }}" redirects_pageid.txt ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects_pageid.txt
- name: Nginx Config Test and Restart
run: |
ssh -i "${{ secrets.SERVER_SSH_PRIVATE_KEY }}" \
"${{ secrets.USERNAME }}@${{ secrets.SERVER_IP }}" \
"service nginx configtest && service nginx restart"
"${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}" \
"service nginx configtest && service nginx restart"
- name: Archive Artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 7a8ad2e

Please sign in to comment.