|
| 1 | +name: deploy |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - deploy-staging |
| 6 | + - deploy-production |
| 7 | + |
| 8 | +jobs: |
| 9 | + deploy: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + |
| 14 | + - name: Set staging variables |
| 15 | + run: | |
| 16 | + echo "ENVIRONMENT_URL=https://your_service.npm.red" >> $GITHUB_ENV |
| 17 | + echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_STAGING_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV |
| 18 | + if: github.ref == 'refs/heads/deploy-staging' |
| 19 | + |
| 20 | + - name: Set production variables |
| 21 | + run: | |
| 22 | + echo "ENVIRONMENT_URL=https://your_service.internal.npmjs.com" >> $GITHUB_ENV |
| 23 | + echo "DEPLOYMENT_CONFIDENCE_URL=${{ secrets.DATADOG_PRODUCTION_DEPLOYMENT_DASHBOARD_URL }}" >> $GITHUB_ENV |
| 24 | + if: github.ref == 'refs/heads/deploy-production' |
| 25 | + |
| 26 | + - name: create a deployment |
| 27 | + uses: npm/action-deploy@v2 |
| 28 | + with: |
| 29 | + type: create |
| 30 | + token: ${{github.token}} |
| 31 | + logs: https://github.slack.com/archives/C02UYAZ5P # npm-deploys channel |
| 32 | + environment_url: ${{env.ENVIRONMENT_URL}} |
| 33 | + deployment_confidence_url: ${{env.DEPLOYMENT_CONFIDENCE_URL}} |
| 34 | + job_status: ${{job.status}} # keep that to track status of the current job, when deployment is completed |
| 35 | + slack_token: ${{secrets.NPM_ROBOT_SLACK_TOKEN}} |
| 36 | + slack_channel: npm-ops |
| 37 | + |
| 38 | + # change to actual deployment steps |
| 39 | + - name: placeholder for actual deployment |
| 40 | + run: sleep 10s |
| 41 | + - name: Setup .NET Core SDK |
| 42 | + |
| 43 | + uses: actions/setup-dotnet@v3.2.0 |
| 44 | + |
| 45 | + with: |
| 46 | + |
| 47 | + # 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 |
| 48 | + |
| 49 | + dotnet-version: # optional |
| 50 | + |
| 51 | + # Optional quality of the build. The possible values are: daily, signed, validated, preview, ga. |
| 52 | + |
| 53 | + dotnet-quality: # optional |
| 54 | + |
| 55 | + # Optional global.json location, if your global.json isn't located in the root of the repo. |
| 56 | + |
| 57 | + global-json-file: # optional |
| 58 | + |
| 59 | + # 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 |
| 60 | + |
| 61 | + source-url: # optional |
| 62 | + |
| 63 | + # 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 |
| 64 | + |
| 65 | + owner: # optional |
| 66 | + |
| 67 | + # Optional NuGet.config location, if your NuGet.config isn't located in the root of the repo. |
| 68 | + |
| 69 | + config-file: # optional |
| 70 | + |
| 71 | + # Optional input to enable caching of the NuGet global-packages folder |
| 72 | + |
| 73 | + cache: # optional |
| 74 | + |
| 75 | + # Used to specify the path to a dependency file: packages.lock.json. Supports wildcards or a list of file names for caching multiple dependencies. |
| 76 | + |
| 77 | + cache-dependency-path: # optional |
0 commit comments