-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.57 KB
/
continuous-deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Continuous deployment workflow
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
continuous-deployment:
runs-on: ubuntu-latest
steps:
- name: Fetch the repository
uses: actions/checkout@v4
- name: Install the dependencies
run: npm install
- name: Create testing environment variables files
run: |
echo "NODE_ENV=testing" >> .env.testing
echo "${{ secrets.TESTING_ENV_FILE_CONTENT }}" >> .env.testing
- name: Run tests
run: npm run test
- name: Collect tests code coverage report
uses: ./tests-code-coverage-report/
- name: Deploy tests code coverage report
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN_GITHUB }}
folder: deploy-tests-code-coverage-report
target-folder: tests-code-coverage-report
repository-name: AbdulrhmanGoni/AM-store-server-tests-code-coverage-report
branch: main
commit-message: "test:(code coverage) update tests code coverage report"
- name: Build the Docker Image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/am-store-server .
- name: Log in to Docker hub
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push the Docker Image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/am-store-server
- name: Trigger deploy event for the server
run: curl ${{ secrets.RENDER_DEPLOY_HOOK_URL }}