11# This worklflow will perform following actions when the code is pushed to development branch:
22# - Run end to end test.
33# - Check Linting.
4- # - Build the latest docker image in development which needs both e2etest and lint to pass first.
4+ # - Build the latest docker image in development which needs both e2e and lint to pass first.
55# - Push the latest docker image to Google Artifact Registry-Dev.
66# - Rollout the latest image in GKE.
77#
1616 branches : [development]
1717
1818env :
19- PROJECT_ID : ${{ secrets.GKE_PROJECT }}
20- GKE_CLUSTER_DEV : nmrxiv-dev
21- GKE_ZONE : europe-west3-a
2219 DEPLOYMENT_NAME : nmrxiv-nmrium
2320 DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
2421 DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_HUB_PASSWORD }}
2522 REPOSITORY_NAME : nmrium-react-wrapper
2623 REPOSITORY_NAMESPACE : nfdi4chem
2724
2825jobs :
29- e2etest :
26+ e2e :
3027 uses : NFDI4Chem/nmrium-react-wrapper/.github/workflows/e2e.yml@main
3128
3229 lint :
@@ -36,25 +33,15 @@ jobs:
3633 name : Deploy to dev
3734 if : github.ref == 'refs/heads/development'
3835 runs-on : ubuntu-latest
39- needs : [lint, e2etest ]
36+ needs : [lint, e2e ]
4037 steps :
4138 - name : Checkout
42- uses : actions/checkout@v3
39+ uses : actions/checkout@v4
4340
44- # Setup gcloud CLI
45- - name : Setup CLI
46- uses : google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
47- with :
48- service_account_key : ${{ secrets.GKE_SA_KEY }}
49- project_id : ${{ secrets.GKE_PROJECT }}
50-
51- # Get the GKE credentials so we can deploy to the cluster
52- - name : Get GKE credentials
53- uses :
google-github-actions/[email protected] 54- with :
55- cluster_name : ${{ env.GKE_CLUSTER_DEV }}
56- location : ${{ env.GKE_ZONE }}
57- credentials : ${{ secrets.GKE_SA_KEY }}
41+ - name : Update version number
42+ run : |
43+ VERSION=${GITHUB_REF//*\/}
44+ echo "export default { version: '$VERSION' };" > src/versionInfo.ts
5845
5946 - name : Log in to Docker Hub
6047 uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
7360 tags : ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-latest
7461 username : ${{ env.DOCKER_HUB_USERNAME }}
7562 password : ${{ env.DOCKER_HUB_PASSWORD }}
76-
77- # Deploy the latest Docker image to the GKE cluster
78- - name : Deploy
79- run : |-
80- kubectl rollout restart deployment/$DEPLOYMENT_NAME
81- kubectl rollout status deployment/$DEPLOYMENT_NAME --timeout=300s
82- kubectl get services -o wide
0 commit comments