Skip to content

Test graph repository (#115) #128

Test graph repository (#115)

Test graph repository (#115) #128

name: dotnet CI release
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
version:
needs: [build, test]
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
dotnetdev_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 }}/dotnetdev:${{ steps.tag_version.outputs.new_tag }} .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/dotnetdev:${{ steps.tag_version.outputs.new_tag }}
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/dotnetdev:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/dotnetdev:latest
# docker build -f=Dockerfile2 -t ${{ secrets.DOCKERHUB_USERNAME }}/migrateimage:${{ steps.tag_version.outputs.new_tag }} .
# docker push ${{ secrets.DOCKERHUB_USERNAME }}/migrateimage:${{ steps.tag_version.outputs.new_tag }}
# docker build -f=Dockerfile2 -t ${{ secrets.DOCKERHUB_USERNAME }}/migrateimage:latest .
# docker push ${{ secrets.DOCKERHUB_USERNAME }}/migrateimage: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/dotnetdev:.*|repository: yaghooli/dotnetdev:${{ needs.version.outputs.dotnetdev_version }}|' values.yaml
sed -i 's|repository: yaghooli/migrateimage:.*|repository: yaghooli/migrateimage:${{ needs.version.outputs.dotnetdev_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
steps:
- uses: actions/checkout@v3
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Install dependencies
working-directory: AnalysisData
run: dotnet restore ./AnalysisData.sln
- name: Build
working-directory: AnalysisData
run: dotnet build ./AnalysisData.sln
- name: Test with the dotnet CLI
working-directory: AnalysisData
run: dotnet test ./AnalysisData.sln