2020 GKE_CLUSTER_DEV : nmrxiv-dev
2121 GKE_ZONE : europe-west3-a
2222 DEPLOYMENT_NAME : nmrxiv-nmrium
23- REPOSITORY_NAME_DEV : nmrxiv-dev
24- IMAGE : nmrium
23+ DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
24+ DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_HUB_PASSWORD }}
25+ REPOSITORY_NAME : nmrium-react-wrapper
26+ REPOSITORY_NAMESPACE : nfdi4chem
2527
2628jobs :
2729 e2etest :
3739 needs : [lint, e2etest]
3840 steps :
3941 - name : Checkout
40- uses : actions/checkout@v2
42+ uses : actions/checkout@v3
43+
44+ - name : Update version number
45+ run : |
46+ VERSION=${GITHUB_REF//*\/}
47+ echo "export default { version: '$VERSION' };" > src/versionInfo.ts
4148
4249 # Setup gcloud CLI
4350 - name : Setup CLI
4653 service_account_key : ${{ secrets.GKE_SA_KEY }}
4754 project_id : ${{ secrets.GKE_PROJECT }}
4855
49- # Configure docker to use the gcloud command-line tool as a credential helper
50- - name : Configure docker
51- run : |-
52- gcloud auth configure-docker europe-west3-docker.pkg.dev
53-
5456 # Get the GKE credentials so we can deploy to the cluster
5557 - name : Get GKE credentials
5658 uses : google-github-actions/get-gke-credentials@v0.3.0
@@ -59,15 +61,23 @@ jobs:
5961 location : ${{ env.GKE_ZONE }}
6062 credentials : ${{ secrets.GKE_SA_KEY }}
6163
62- # Build the Docker image
63- - name : Build docker image
64- run : |-
65- docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
64+ - name : Log in to Docker Hub
65+ uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
66+ with :
67+ username : ${{ env.DOCKER_HUB_USERNAME }}
68+ password : ${{ env.DOCKER_HUB_PASSWORD }}
6669
67- # Push the Docker image to Google Artifact Registry
68- - name : Publish image to Google Artifact Registry
69- run : |-
70- docker push "europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest"
70+ - name : Build and push Docker image
71+ uses : docker/build-push-action@v4
72+ with :
73+ context : .
74+ file : ./Dockerfile.prod
75+ push : true
76+ build-args : |
77+ RELEASE_VERSION=dev-latest
78+ tags : ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-latest
79+ username : ${{ env.DOCKER_HUB_USERNAME }}
80+ password : ${{ env.DOCKER_HUB_PASSWORD }}
7181
7282 # Deploy the latest Docker image to the GKE cluster
7383 - name : Deploy
0 commit comments