using fonts testingmachien #162
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: CI/CD | |
on: | |
push: | |
pull_request: | |
env: | |
PROJECT_NAME: odh-databrowser-core | |
DOCKER_IMAGE: ghcr.io/${{ github.repository }}/${{ github.event.repository.name }} | |
DOCKER_TAG: ${{ github.sha }} | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v1 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore odh-databrowser-core.sln | |
- name: Build | |
run: dotnet build odh-databrowser-core.sln --no-restore | |
- name: Test | |
run: dotnet test odh-databrowser-core.sln --no-build --verbosity normal | |
deploy-test: | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/main' | |
needs: test | |
concurrency: deploy-test | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }} | |
X_DOCKER_TAG: ${{ env.DOCKER_TAG }} | |
X_SERVER_PORT: 1022 | |
X_ASPNETCORE_ENVIRONMENT: "Development" | |
X_OAUTH_AUTORITY: "https://auth.opendatahub.testingmachine.eu/auth/realms/noi/" | |
X_OAUTH_CLIENTID: ${{ secrets.OAUTH_CLIENTID }} | |
- name: Build and push | |
uses: noi-techpark/github-actions/docker-build-and-push@v2 | |
with: | |
docker-username: ${{ github.actor }} | |
docker-password: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: ./ | |
docker-compose-file: docker-compose.yml | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'test' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} | |
deploy-prod: | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/prod' | |
needs: test | |
concurrency: deploy-prod | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }} | |
X_DOCKER_TAG: ${{ env.DOCKER_TAG }} | |
X_SERVER_PORT: 1022 | |
X_ASPNETCORE_ENVIRONMENT: "Production" | |
X_OAUTH_AUTORITY: "https://auth.opendatahub.com/auth/realms/noi/" | |
X_OAUTH_CLIENTID: ${{ secrets.OAUTH_CLIENTID }} | |
- name: Build and push | |
uses: noi-techpark/github-actions/docker-build-and-push@v2 | |
with: | |
docker-username: ${{ github.actor }} | |
docker-password: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: ./ | |
docker-compose-file: docker-compose.yml | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'prod' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} |