Skip to content

Commit

Permalink
Create Setup .NET Core SDK
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Ken  <samkenxhub@gmail.com>
  • Loading branch information
samkenxstream committed Jun 6, 2023
1 parent 6d20bdc commit b6fc6e1
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/deploy.yml/Setup .NET Core SDK
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: deploy
on:
push:
branches:
- deploy-staging
- deploy-production

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set staging variables
run: |
echo "ENVIRONMENT_URL=https://your_service.npm.red" >> $GITHUB_ENV
echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_STAGING_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV
if: github.ref == 'refs/heads/deploy-staging'

- name: Set production variables
run: |
echo "ENVIRONMENT_URL=https://your_service.internal.npmjs.com" >> $GITHUB_ENV
echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_PRODUCTION_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV
if: github.ref == 'refs/heads/deploy-production'

- name: create a deployment
uses: npm/action-deploy@v2
with:
type: create
token: ${{github.token}}
logs: https://github.slack.com/archives/C02UYAZ5P # npm-deploys channel
environment_url: ${{env.ENVIRONMENT_URL}}
deployment_confidence_url: ${{env.DEPLOYMENT_CONFIDENCE_URL}}
job_status: ${{job.status}} # keep that to track status of the current job, when deployment is completed
slack_token: ${{secrets.NPM_ROBOT_SLACK_TOKEN}}
slack_channel: npm-ops

# change to actual deployment steps
- name: placeholder for actual deployment
run: sleep 10s
- name: Setup .NET Core SDK

uses: actions/setup-dotnet@v3.2.0

with:

# Optional SDK version(s) to use. If not provided, will install global.json version when available. Examples: 2.2.104, 3.1, 3.1.x, 3.x, 6.0.2xx

dotnet-version: # optional

# Optional quality of the build. The possible values are: daily, signed, validated, preview, ga.

dotnet-quality: # optional

# Optional global.json location, if your global.json isn't located in the root of the repo.

global-json-file: # optional

# Optional package source for which to set up authentication. Will consult any existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the NUGET_AUTH_TOKEN environment variable as a ClearTextPassword

source-url: # optional

# Optional OWNER for using packages from GitHub Package Registry organizations/users other than the current repository's owner. Only used if a GPR URL is also provided in source-url

owner: # optional

# Optional NuGet.config location, if your NuGet.config isn't located in the root of the repo.

config-file: # optional

# Optional input to enable caching of the NuGet global-packages folder

cache: # optional

# Used to specify the path to a dependency file: packages.lock.json. Supports wildcards or a list of file names for caching multiple dependencies.

cache-dependency-path: # optional

0 comments on commit b6fc6e1

Please sign in to comment.