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 1943a6f commit a903a35
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/doc.nuxeo.com.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@ on:
branches:
- master
- development
schedule:
- cron: '0 0 * * *' # Every night at midnight
workflow_dispatch: # Manual triggering

jobs:
documentation_ci:
name: Build & Publish documentation to ${{ github.ref_name == 'master' && 'production' || 'development' }}
runs-on: ubuntu-latest
runs-on: doc
environment:
name: ${{ github.ref_name == 'master' && 'production' || 'development' }}
steps:
- name: Install SSH key for Bastion
uses: shimataro/ssh-key-action@v2
with:
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

- name: Configure SSH client
run: |
echo "$SSH_CONFIG" >> $HOME/.ssh/config
env:
SSH_CONFIG: "${{ secrets.SSH_CONFIG }}"

- name: Set up SSH
uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0
with:
key: ${{ secrets.DEV_TOOLS_EC2_PRIVATE_KEY }}
name: id_rsa-target
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }}
config: ${{ secrets.CONFIG }}
ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -60,13 +59,14 @@ jobs:
- name: Deploy to Server
run: |
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"
rsync -Wxvurk --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
- name: Apache Config Test and Restart
- name: Nginx Config Test and Restart
run: |
ssh -o StrictHostKeyChecking=no -T lethe.nuxeo.com "apache2ctl configtest && service apache2 restart"
ssh "${{ 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 a903a35

Please sign in to comment.