-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (92 loc) · 3.31 KB
/
angularCI_release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: angular CI release
on:
push:
branches: [ "main" ]
jobs:
version:
needs: [build, test]
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
frontimage_version: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Print new tag
run: echo ${{ steps.tag_version.outputs.new_tag }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
# registry: registry.abriment.com
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build the Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/frontangular:${{ steps.tag_version.outputs.new_tag }} .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/frontangular:${{ steps.tag_version.outputs.new_tag }}
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/frontangular:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/frontangular:latest
update-helm:
runs-on: ubuntu-latest
needs: [version]
steps:
- name: Clone Deployment Repository
uses: GuillaumeFalourd/[email protected]
with:
depth: 1
branch: 'main'
owner: 'Star-Academy'
repository: 'Summer1403-Project-Group03-Deployment'
- name: Access cloned repository content
run: |
cd Summer1403-Project-Group03-Deployment
cd data_analysis
sed -i 's|repository: yaghooli/frontangular:.*|repository: yaghooli/frontangular:${{ needs.version.outputs.frontimage_version }}|' values.yaml
cat values.yaml
git config --global user.email "[email protected]"
git config --global user.name "ali"
git add values.yaml
git commit -m "Update values.yaml"
- name: Push to Deployment Repository
run: |
cd Summer1403-Project-Group03-Deployment
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/Star-Academy/Summer1403-Project-Group03-Deployment.git
git push
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
working-directory: .
run: npm ci
- name: Build project
working-directory: .
run: npm run build --if-present
test:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: test in container
run: docker build -t node-docker-image-test --no-cache --target test .