forked from Jeoungseungho/plugin-google-cloud-services
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.6 KB
/
CI_master_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: "[CI]master push"
on:
push:
paths-ignore:
- '.github/**'
branches:
- master
workflow_dispatch:
env:
ORGANIZATION: pyengine
jobs:
versioning:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.job1.outputs.VERSION }}
steps:
- uses: actions/checkout@v2
- name: calculate current date
run: |
sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
echo "TIME=$(date +'%Y%m%d.%H%M%S')" >> $GITHUB_ENV
- name: calculate_version
id: job1
run: |
echo "::set-output name=VERSION::$(cat src/VERSION | cut -c 2-).${{ env.TIME }}"
docker:
if: github.repository_owner == 'spaceone-dev'
needs: versioning
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.versioning.outputs.version }}
steps:
- uses: actions/checkout@v2
- name: get service name
run: |
echo "SERVICE=$(echo ${{ github.repository }} | cut -d '/' -f2)" >> $GITHUB_ENV
- name: Upload docker
uses: docker/build-push-action@v1
with:
path: .
repository: ${{ env.ORGANIZATION }}/${{ env.SERVICE }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ env.VERSION }}
- name: Slack
if: always()
uses: 8398a7/[email protected]
with:
status: ${{job.status}}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
author_name: Github Action Slack
env:
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}