clean #573
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: Build and deploy | |
on: | |
workflow_call: | |
push: | |
branches: | |
- main | |
# tags: | |
# - "v**" | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
branches: | |
- main | |
jobs: | |
build-frontend: | |
uses: gig3r-com/giger/.github/workflows/build-docker-image.yaml@main | |
with: | |
DOCKER_CONTEXT: ./frontend | |
DOCKERFILE_NAME: ./frontend/Dockerfile | |
IMAGE_NAME: "gig3r-frontend" | |
IMAGE_TAG: ${{ github.sha }} | |
secrets: inherit | |
build-backend: | |
uses: gig3r-com/giger/.github/workflows/build-docker-image.yaml@main | |
with: | |
DOCKER_CONTEXT: ./backendDotnet/Giger | |
DOCKERFILE_NAME: ./backendDotnet/Dockerfile | |
IMAGE_NAME: "gig3r-backend" | |
IMAGE_TAG: ${{ github.sha }} | |
secrets: inherit | |
build-mongo: | |
uses: gig3r-com/giger/.github/workflows/build-docker-image.yaml@main | |
with: | |
DOCKER_CONTEXT: ./data/ | |
DOCKERFILE_NAME: ./data/Dockerfile | |
IMAGE_NAME: "gig3r-mongo" | |
IMAGE_TAG: ${{ github.sha }} | |
secrets: inherit | |
deploy-helm-chart: | |
uses: gig3r-com/giger/.github/workflows/deploy-helm-chart.yaml@main | |
needs: | |
- build-frontend | |
- build-backend | |
- build-mongo | |
with: | |
HELM_ENVIRONMENT: ${{ github.event_name != 'pull_request' && 'dev' || '' }} | |
HELM_FRONTEND_IMAGE: "mivalsten/gig3r-frontend" | |
HELM_FRONTEND_TAG: ${{ github.sha }} | |
HELM_BACKEND_IMAGE: "mivalsten/gig3r-backend" | |
HELM_BACKEND_TAG: ${{ github.sha }} | |
HELM_DATABASE_IMAGE: "mivalsten/gig3r-mongo" | |
HELM_DATABASE_TAG: ${{ github.sha }} | |
secrets: inherit | |
comment: | |
if: github.event_name == 'pull_request' | |
runs-on: microk8s-runner-1 | |
needs: [ deploy-helm-chart ] | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'PR had been deployed successfully. \nEnvironment address is: [${{ needs.deploy-helm-chart.outputs.address }}](https://${{ needs.deploy-helm-chart.outputs.address }}) \nIt may take up to 10 minutes for DNS to propagate.' | |
}) |