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 :
28- runs-on : ubuntu-latest
29- strategy :
30- matrix :
31- project : [chromium, firefox, webkit]
32- fail-fast : false
33- steps :
34- - uses : actions/checkout@v3
35- - uses : actions/setup-node@v3
36- with :
37- node-version : 18.x
38- - name : Install dependencies
39- run : npm ci
40- - name : Install Playwright
41- run : npx playwright install --with-deps
42- - name : Build test application
43- run : npm run build-no-minify
44- - name : Run E2E tests on ${{ matrix.project }}
45- run : npx playwright test --project ${{ matrix.project }}
46- continue-on-error : ${{ matrix.project == 'webkit' }}
47- - name : Upload test results
48- if : always()
49- uses : actions/upload-artifact@v3
50- with :
51- name : test-results-${{ matrix.project }}
52- path : test-results
30+ uses : NFDI4Chem/nmrium-react-wrapper/.github/workflows/e2e.yml@main
5331
5432 lint :
55- runs-on : ubuntu-latest
56- steps :
57- - uses : actions/checkout@v2
58- - uses : actions/setup-node@v2
59- with :
60- node-version : 16.x
61- - name : Install dependencies
62- run : npm ci
63- - name : Run ESLint
64- run : npm run eslint
65- - name : Run Prettier
66- run : npm run prettier
67- - name : Check types
68- run : npm run check-types
33+ uses : NFDI4Chem/nmrium-react-wrapper/.github/workflows/nodejs.yml@main
6934
7035 setup-build-publish-deploy-dev :
7136 name : Deploy to dev
7439 needs : [lint, e2etest]
7540 steps :
7641 - name : Checkout
77- 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
7848
7949 # Setup gcloud CLI
8050 - name : Setup CLI
8353 service_account_key : ${{ secrets.GKE_SA_KEY }}
8454 project_id : ${{ secrets.GKE_PROJECT }}
8555
86- # Configure docker to use the gcloud command-line tool as a credential helper
87- - name : Configure docker
88- run : |-
89- gcloud auth configure-docker europe-west3-docker.pkg.dev
90-
9156 # Get the GKE credentials so we can deploy to the cluster
9257 - name : Get GKE credentials
9358 uses : google-github-actions/get-gke-credentials@v0.3.0
@@ -102,15 +67,17 @@ jobs:
10267 username : ${{ env.DOCKER_HUB_USERNAME }}
10368 password : ${{ env.DOCKER_HUB_PASSWORD }}
10469
105- # Build the Docker image
106- - name : Build docker image
107- run : |-
108- docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
109-
110- # Push the Docker image to Google Artifact Registry
111- - name : Publish image to Google Artifact Registry
112- run : |-
113- 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 }}
11481
11582 # Deploy the latest Docker image to the GKE cluster
11683 - name : Deploy
0 commit comments