name: ci on: [push] env: dotnet-version: '6.0.x' jobs: build: runs-on: ubuntu-latest name: Build & Unit Test steps: - uses: actions/checkout@v3 - name: Setup .NET Core SDK ${{ env.dotnet-version }} uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: ${{ env.dotnet-version }} - name: Install Dependencies run: dotnet restore - name: Build run: dotnet build --configuration Release --no-restore - name: Test run: dotnet test --no-restore --verbosity normal deploytest: runs-on: ubuntu-latest name: Deploy Test environment: name: test url: https://test.mixonomer.sarsoo.xyz needs: build # for ignoring bad builds if: github.event_name == 'push' steps: - uses: actions/checkout@v3 # get source - name: Set up Cloud SDK uses: google-github-actions/auth@v0.7.3 with: credentials_json: '${{ secrets.GCP_SA_KEY }}' export_environment_variables: true create_credentials_file: true - name: Deploy RunUserPlaylist run: | gcloud functions deploy RunUserPlaylist \ --region europe-west2 \ --gen2 \ --runtime=dotnet6 \ --trigger-topic RunUserPlaylist \ --set-env-vars GOOGLE_CLOUD_PROJECT=${{ vars.GCP_PROJECT }} \ --service-account runuserplaylist-func@${{ vars.GCP_PROJECT }}.iam.gserviceaccount.com \ --set-build-env-vars=GOOGLE_BUILDABLE=Mixonomer.Func shell: bash