Skip to content

Commit 97e6201

Browse files
Merge pull request #12 from logicalley/feat/configure-ci-cd
Configure CI/CD pipeline for Annie Web
2 parents 1c6e518 + 7630c11 commit 97e6201

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

.github/workflows/prod.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Annie Web Production CI
2+
3+
on:
4+
push:
5+
tags:
6+
- v-*
7+
8+
steps:
9+
deployToProd:
10+
name: 'Deploy to Netlify'
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- uses: jsmrcaga/action-netlify-deploy@master
18+
with:
19+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
20+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
21+
NETLIFY_DEPLOY_MESSAGE: "Production deploy v${{ github.ref }}"
22+
NETLIFY_DEPLOY_TO_PROD: true

.github/workflows/stage.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Annie Web Staging CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
deployToStaging:
9+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
10+
11+
env:
12+
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Notify slack stage build
20+
id: slack # IMPORTANT: reference this step ID value in future Slack steps
21+
env:
22+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
23+
uses: voxmedia/github-action-slack-notify-build@v1
24+
with:
25+
channel_id: C01HMJ656KV
26+
status: STARTING
27+
color: warning
28+
29+
- uses: akhileshns/[email protected] # This is the action
30+
with:
31+
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
32+
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} # Must be unique in Heroku
33+
heroku_email: ${{ secrets.HEROKU_EMAIL }}
34+
35+
- name: Notify slack fail
36+
if: failure()
37+
env:
38+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
39+
uses: voxmedia/github-action-slack-notify-build@v1
40+
with:
41+
# Updates existing message from the first step
42+
message_id: ${{ steps.slack.outputs.message_id }}
43+
channel_id: C01HMJ656KV
44+
status: FAILED
45+
color: danger
46+
47+
- name: Notify slack success
48+
if: success()
49+
env:
50+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
51+
uses: voxmedia/github-action-slack-notify-build@v1
52+
with:
53+
# Updates existing message from the first step
54+
message_id: ${{ steps.slack.outputs.message_id }}
55+
channel_id: C01HMJ656KV
56+
status: SUCCESS
57+
color: good

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: yarn start -p $PORT

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Netlify Status](https://api.netlify.com/api/v1/badges/6379935d-afc7-453f-8c6d-ab8adbfa057d/deploy-status)](https://app.netlify.com/sites/angry-northcutt-0dcebf/deploys)
1+
[![Netlify Status](https://api.netlify.com/api/v1/badges/6379935d-afc7-453f-8c6d-ab8adbfa057d/deploy-status)](https://app.netlify.com/sites/annie-web-prod/deploys)
22

33
# ANNIE-WEB
44

0 commit comments

Comments
 (0)