Skip to content

Revert "phenotypes working" #347

Revert "phenotypes working"

Revert "phenotypes working" #347

name: CI
on:
push:
branches:
- "*"
tags:
- "V*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Clear npm cache
run: npm cache clean --force
- name: Remove node_modules and package-lock.json
run: rm -rf node_modules package-lock.json
- name: Install dependencies
run: npm i
- name: Run tests
run: npm run test
- name: Create .env file
run: |
echo "NUXT_PUBLIC_PHENOTYPES_URL=https://bioindex.hugeamp.org/api/portal/phenotypes" > .env
echo "NUXT_PUBLIC_GOOGLE_AUTH_CLIENT_ID=${{ secrets.GOOGLE_AUTH_CLIENT_ID }}" >> .env
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "NUXT_PUBLIC_GOOGLE_AUTH_REDIRECT_URI=https://kpndataregistry.org:8000/login/callback" >> .env
echo "NUXT_PUBLIC_API_BASE_URL=https://api.kpndataregistry.org:8000" >> .env
elif [[ $GITHUB_REF == refs/tags/V* ]]; then
echo "NUXT_PUBLIC_GOOGLE_AUTH_REDIRECT_URI=https://kpndataregistry.org/login/callback" >> .env
echo "NUXT_PUBLIC_API_BASE_URL=https://api.kpndataregistry.org" >> .env
fi
- name: Build
run: npx nuxt generate -v
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: nuxt-build
path: .output/public
deploy-qa:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [build]
name: Deploy to QA
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: nuxt-build
- name: Clear Remote Directory
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ec2-user
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
rm -rf /home/ec2-user/dr-frontend-dev/.output/*
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ec2-user
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: "*"
debug: true
target: "/home/ec2-user/dr-frontend-dev/.output/public"
deploy-prod:
needs: [build]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/V')
name: Deploy to Prod
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: nuxt-build
- name: Clear Remote Directory
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ec2-user
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
rm -rf /home/ec2-user/dr-frontend-prod/.output/*
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ec2-user
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
source: "*"
target: "/home/ec2-user/dr-frontend-prod/.output/public"