Skip to content

Commit 6126e5b

Browse files
Create Download a Build Artifact
Signed-off-by: Sam Ken <samkenxhub@gmail.com>
1 parent d667e07 commit 6126e5b

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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: Download a Build Artifact
42+
43+
uses: actions/download-artifact@v2.1.1
44+
45+
with:
46+
47+
# Artifact name
48+
49+
name: # optional
50+
51+
# Destination path
52+
53+
path: # optional

0 commit comments

Comments
 (0)