Skip to content

Commit d500683

Browse files
[CI] Deploy CI
1 parent 4de2afe commit d500683

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "[Push] Build dev"
2+
3+
on:
4+
workflow_dispatch:
5+
repository_dispatch:
6+
types: [master_push]
7+
8+
env:
9+
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}
10+
11+
jobs:
12+
versioning:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
version: ${{ steps.versioning.outputs.VERSION }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: get current date
19+
run: |
20+
sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
21+
echo "TIME=$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_ENV
22+
- name: set version with current date
23+
id: versioning
24+
run: |
25+
echo "::set-output name=VERSION::$(cat src/VERSION | cut -c 2-).${{ env.TIME }}"
26+
- name: Notice when job fails
27+
if: failure()
28+
uses: 8398a7/action-slack@v3.2.0
29+
with:
30+
status: ${{job.status}}
31+
fields: repo,workflow,job
32+
author_name: Github Action Slack
33+
34+
docker:
35+
if: github.repository_owner == 'cloudforet-io'
36+
needs: versioning
37+
runs-on: ubuntu-latest
38+
env:
39+
VERSION: ${{ needs.versioning.outputs.version }}
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: get service name
43+
run: |
44+
echo "SERVICE=$(echo ${{ github.repository }} | cut -d '/' -f2)" >> $GITHUB_ENV
45+
- name: Upload docker
46+
uses: docker/build-push-action@v1
47+
with:
48+
path: .
49+
repository: pyengine/${{ env.SERVICE }}
50+
username: ${{ secrets.DOCKER_USERNAME }}
51+
password: ${{ secrets.DOCKER_PASSWORD }}
52+
tags: ${{ env.VERSION }}
53+
- name: Notice when job fails
54+
if: failure()
55+
uses: 8398a7/action-slack@v3.2.0
56+
with:
57+
status: ${{job.status}}
58+
fields: repo,workflow,job
59+
author_name: Github Action Slack
60+
61+
notification:
62+
runs-on: ubuntu-latest
63+
needs: docker
64+
steps:
65+
- name: Slack
66+
if: always()
67+
uses: 8398a7/action-slack@v3.2.0
68+
with:
69+
status: ${{job.status}}
70+
fields: repo,message,commit,author,action,ref,workflow,job
71+
author_name: Github Action Slack

0 commit comments

Comments
 (0)