-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Update Workflow to Publish image, Deployment. Fix Codebase vu…
…lnerability"
- Loading branch information
Showing
12 changed files
with
100 additions
and
468 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: OHRI CI - | ||
name: OHRI CI | ||
|
||
on: | ||
push: | ||
|
@@ -128,97 +128,42 @@ jobs: | |
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | ||
|
||
docker_devserver_frontend: | ||
runs-on: ubuntu-latest | ||
needs: docker_setup | ||
|
||
steps: | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./frontend | ||
file: ./frontend/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-dev-frontend:next,${{ secrets.DOCKERHUB_USERNAME }}/ohri-dev-frontend:ci_${{ github.run_number }} | ||
cache-from: type=inline,ref=user/app:buildcache | ||
cache-to: type=inline,ref=user/app:buildcache,mode=max | ||
|
||
dev_server_status: | ||
if: github.ref == 'refs/heads/dev' | ||
runs-on: ubuntu-latest | ||
needs: docker_staging_backend | ||
working: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Wait for 5 minutos - Let Images reflect on Docker Hub | ||
run: sleep 300 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
needs: pre_release | ||
|
||
- name: Copy files to /home/runner/ | ||
run: | | ||
ls -la -t | ||
cp -r $GITHUB_WORKSPACE/.ssh/ /home/runner/ | ||
if: ${{ github.ref == 'refs/heads/working' }} | ||
|
||
- name: List contents of /home/runner/ | ||
run: ls -la /home/runner/ | ||
steps: | ||
# Update the Microfrontends to reflect what we have in the Working branch | ||
- uses: garygrossgarten/github-action-ssh@release | ||
name: Run the Update MicroFronEnd Script | ||
with: | ||
command: cd /usr/share/tomcat/microfrontends/working && /bin/bash update_microfrontends.sh | ||
host: ${{ secrets.HISTAC_HOST }} | ||
username: ${{ secrets.HISTAC_USERNAME }} | ||
privateKey: ${{ secrets.HISTAC_KEY}} | ||
port: ${{ secrets.HISTAC_PORT }} | ||
|
||
- name: webfactory/ssh-agent | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.LL_SSH_PRIVATE_KEY }} | ||
|
||
- name: Check SSH to remote OHRI Dev status | ||
run: | | ||
ssh-keygen -R 172.19.0.16 | ||
dev_server_connection_dev: | ||
runs-on: ubuntu-latest | ||
needs: dev_server_status | ||
steps: | ||
- name: SSH to remote OHRI Dev server | ||
run: | | ||
ssh -o StrictHostKeyChecking=no -T [email protected] -p 2216 -J [email protected] -p 2202 | ||
ls -la -t && \ | ||
cd /opt && \ | ||
ls -la -t | ||
dev_deploy: | ||
ohri_dev: | ||
runs-on: ubuntu-latest | ||
needs: dev_server_status | ||
|
||
if: (github.event_name == 'push' || github.event.pull_request.merged) | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
needs: pre_release | ||
|
||
- name: webfactory/ssh-agent | ||
uses: webfactory/[email protected] | ||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
|
||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
- name: Compute Timestamp | ||
run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- uses: garygrossgarten/github-action-ssh@release | ||
name: Run the Update MicroFronEnd Script | ||
with: | ||
ssh-private-key: ${{ secrets.LL_SSH_PRIVATE_KEY }} | ||
command: cd /usr/share/tomcat/microfrontends/dev && /bin/bash update_microfrontends.sh | ||
host: ${{ secrets.HISTAC_HOST }} | ||
username: ${{ secrets.HISTAC_USERNAME }} | ||
privateKey: ${{ secrets.HISTAC_KEY}} | ||
|
||
- name: SSH to remote OHRI Dev server via jump host | ||
run: | | ||
ssh -p 2216 \ | ||
-o "UserKnownHostsFile=/dev/null" \ | ||
-o "StrictHostKeyChecking=no" \ | ||
-o "ProxyCommand=ssh -o StrictHostKeyChecking=no -W %h:%p [email protected] -p 2202" \ | ||
[email protected] "\ | ||
cd /opt && \ | ||
docker compose -f docker-compose-ohri-dev.yml pull && \ | ||
docker compose -f docker-compose-ohri-dev.yml stop && \ | ||
docker compose -f docker-compose-ohri-dev.yml up -d" | ||
port: ${{ secrets.HISTAC_PORT }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.