feat(test): add user service test (#47) #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |