Skip to content

Commit

Permalink
data deploy or not
Browse files Browse the repository at this point in the history
  • Loading branch information
iimpulse committed May 7, 2024
1 parent 2e331d9 commit e4abd57
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/network-data-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Deploy Data
on:
workflow_dispatch:
inputs:
redeploy:
description: 'Redeploy Only'
reload:
description: 'Data Reload'
default: true
required: true
type: boolean
Expand All @@ -18,7 +18,7 @@ env:

jobs:
build:
if: ${{ inputs.redeploy != true }}
if: ${{ inputs.reload == true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -70,32 +70,7 @@ jobs:
gsutil -m rm -r gs://jax-robinson-ontology-annotation-network-data/data/
gsutil -m cp -r ./neo4j/data/* gs://jax-robinson-ontology-annotation-network-data/data/
- name: Stop prod container, Swap disk to loader
id: swap1
run: |
# Stop the instance
gcloud compute instances stop ontology-annotation-network-containerized --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
# Detach disk
gcloud compute instances detach-disk ontology-annotation-network-containerized --disk=graph-data --zone=us-east1-b
# Attach disk to loader
gcloud compute instances attach-disk ontology-annotation-loader --disk=graph-data --zone=us-east1-b
# turn on loader
gcloud compute instances start ontology-annotation-loader --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
- name: Stop loader container, Swap disk to prod
id: swap2
run: |
# turn off loader
gcloud compute instances stop ontology-annotation-loader --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
# detach disk
gcloud compute instances detach-disk ontology-annotation-loader --disk=graph-data --zone=us-east1-b
# re-attach disk
gcloud compute instances attach-disk ontology-annotation-network-containerized --disk=graph-data --zone=us-east1-b
# turn on instance
gcloud compute instances start ontology-annotation-network-containerized --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
redeploy:
if: ${{ inputs.redeploy == true }}
runs-on: ubuntu-latest
steps:
- name: Authenticate to Google Cloud
Expand All @@ -105,6 +80,31 @@ jobs:

- name: Setup Google Cloud CLI
uses: 'google-github-actions/setup-gcloud@v1'

- name: Stop prod container, Swap disk to loader
id: swap1
run: |
# Stop the instance
gcloud compute instances stop ontology-annotation-network-containerized --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
# Detach disk
gcloud compute instances detach-disk ontology-annotation-network-containerized --disk=graph-data --zone=us-east1-b
# Attach disk to loader
gcloud compute instances attach-disk ontology-annotation-loader --disk=graph-data --zone=us-east1-b
# turn on loader
gcloud compute instances start ontology-annotation-loader --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
- name: Stop loader container, Swap disk to prod
id: swap2
run: |
# turn off loader
gcloud compute instances stop ontology-annotation-loader --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
# detach disk
gcloud compute instances detach-disk ontology-annotation-loader --disk=graph-data --zone=us-east1-b
# re-attach disk
gcloud compute instances attach-disk ontology-annotation-network-containerized --disk=graph-data --zone=us-east1-b
# turn on instance
gcloud compute instances start ontology-annotation-network-containerized --project=$GCLOUD_PROJECT_ID --zone=us-east1-b
- name: Redeploy Rest
run: |
gcloud run deploy ontology-annotation-network-rest --quiet \
Expand Down

0 comments on commit e4abd57

Please sign in to comment.