Skip to content

Commit

Permalink
Update doc.nuxeo.com.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aradhanas9 authored Jun 6, 2024
1 parent 9fd52bb commit 1943a6f
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/doc.nuxeo.com.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ jobs:
environment:
name: ${{ github.ref_name == 'master' && 'production' || 'development' }}
steps:
- name: Set up SSH
uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0
- name: Install SSH key for Bastion
uses: shimataro/ssh-key-action@v2
with:
ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}
key: ${{ secrets.DEV_TOOLS_BASTION_PRIVATE_KEY }}
name: id_rsa-bastion
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }}
config: ${{ secrets.CONFIG }}

- name: Install SSH key of target
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEV_TOOLS_EC2_PRIVATE_KEY }}
name: id_rsa-target
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }}
config: ${{ secrets.CONFIG }}

- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -49,14 +60,13 @@ jobs:
- name: Deploy to Server
run: |
rsync -Wxvuk --delete site/ "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/opt/www/doc/"
rsync 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 -Wxvurk --delete site/ "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/opt/www/doc/"
rsync redirects.txt "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/etc/apache2/redirects.txt"
rsync redirects_pageid.txt "ssh -o StrictHostKeyChecking=no" -vz lethe.nuxeo.com:"/etc/apache2/redirects_pageid.txt"
- name: Nginx Config Test and Restart
- name: Apache Config Test and Restart
run: |
ssh "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}" \
"service nginx configtest && service nginx restart"
ssh -o StrictHostKeyChecking=no -T lethe.nuxeo.com "apache2ctl configtest && service apache2 restart"
- name: Archive Artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 1943a6f

Please sign in to comment.