Skip to content

Commit a93474b

Browse files
committed
Create .github/workflows/deploy.yml
1 parent bb6d40b commit a93474b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Diff for: .github/workflows/deploy.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

0 commit comments

Comments
 (0)