-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Basic changes to test local config Include YAML for automated deployment, and README Include deploy script to alternate server Improve the deploy script Create docs-ci.yml (#6) Update the Main CI Improve the deploy script, fix null Key value Fix YML duplication Fix YML duplication Include config update and deployment Include config update and deployment, fix relative path Fix file tree Fix file tree, change action type Fix file tree, change action type, change wrong param Fix file tree, change action type, change wrong param, typo Add final details Change dir Change dir, fix missing clone command Include logging Update OHRI Docs user Change the hidden folder Change to copy contents Change the recursive copy Update to zip due to errors * updates deploy branch to main --------- Co-authored-by: LarsLemos <[email protected]>
- Loading branch information
Showing
4 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Rename the directory with suffix _backup_current_timestamp | ||
|
||
if [ -d "ohri-docs" ]; then | ||
cd .. | ||
mv ohri-docs ohri-docs_backup_$(date +%Y%m%d_%H%M%S) | ||
echo "--- OHRI Backup successful ---" | ||
else | ||
echo "--- ohri-docs folder not found, backup not performed ---" | ||
fi | ||
|
||
# Clone the repository | ||
git clone https://github.com/UCSF-IGHS/ohri-docs.git | ||
|
||
# Navigate into the cloned directory | ||
echo "--- Navigate into the cloned directory ---" | ||
chown -R | ||
cd ohri-docs | ||
ls -la -t | ||
|
||
# Install dependencies and build the code | ||
echo "--- Installing dependencies and building the code ---" | ||
npx yarn install | ||
npx yarn build | ||
|
||
ls -la -t | ||
|
||
# Copy the built code to the specified path on the server using scp | ||
# scp -r ./build user@server:/usr/share/tomcat/microfrontends/ohri-docs | ||
# scp -P 3220 -r .next [email protected]:/usr/share/tomcat/microfrontends/ohri_docs | ||
|
||
echo "--- Copy Hidden folder .next to build folder to allow transfer to another server ---" | ||
zip -r next_deploy.zip .next/ | ||
cp -R .next/* build | ||
|
||
ls -la -t | ||
|
||
scp -P 3220 -r build [email protected]:/usr/share/tomcat/microfrontends/ohri_docs | ||
scp -P 3220 -r next_deploy.zip [email protected]:/usr/share/tomcat/microfrontends/ohri_docs | ||
|
||
# scp -P 3220 -i /usr/local/ohridocs/.ssh/id_rsa -r .next [email protected]:/usr/share/tomcat/microfrontends/ohri_docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,21 +47,44 @@ jobs: | |
- name: Run build | ||
run: pnpm build | ||
|
||
docs_deployment: | ||
update_config: | ||
runs-on: ubuntu-latest | ||
|
||
needs: build | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
|
||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
steps: | ||
- name: Checkout repo to make config folder local | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
- run: ls -la .github/ | ||
|
||
- name: Copy Branch main Import Map to remote | ||
uses: appleboy/[email protected] | ||
with: | ||
source: .github/deploy_docs.sh | ||
target: /usr/share/tomcat/microfrontends/ohri-docs | ||
host: ${{ secrets.HISTAC_HOST }} | ||
username: ${{ secrets.HISTAC_USERNAME }} | ||
key: ${{ secrets.HISTAC_OHRI_KEY}} | ||
port: ${{ secrets.HISTAC_PORT }} | ||
|
||
docs_deployment: | ||
runs-on: ubuntu-latest | ||
needs: update_config | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
|
||
steps: | ||
# Update the Microfrontends to reflect what we have in the Working branch | ||
# Update the Microfrontends to reflect what we have in the working branch | ||
- name: Compute Timestamp | ||
run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- uses: garygrossgarten/github-action-ssh@release | ||
name: BackUp and Run the Update DOCS Site Script | ||
with: | ||
command: cd /usr/share/tomcat/microfrontends/ | ||
sh deploy-ohri-docs.sh | ||
command: cd /usr/share/tomcat/microfrontends/ohri-docs/.github && sh deploy_docs.sh | ||
host: ${{ secrets.HISTAC_HOST }} | ||
username: ${{ secrets.HISTAC_USERNAME }} | ||
privateKey: ${{ secrets.HISTAC_KEY}} | ||
username: ${{ secrets.OHRI_DOCS_USER }} | ||
# username: ${{ secrets.HISTAC_USERNAME }} | ||
privateKey: ${{ secrets.OHRI_DOCS_USER_KEY}} | ||
# privateKey: ${{ secrets.HISTAC_KEY}} | ||
port: ${{ secrets.HISTAC_PORT }} |
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
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