-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.03 KB
/
ci-cd.yml
File metadata and controls
42 lines (38 loc) · 1.03 KB
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
name: Build and Deploy
on:
push:
branches:
- main
- dev
- stg
workflow_dispatch:
inputs:
force:
description: 'Force exec'
type: boolean
required: true
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Env
run: |
COMMIT_SHORT_SHA=`git rev-parse --short ${GITHUB_SHA}`
COMMIT_TIME=`git show -s --format=%ct HEAD`
echo "COMMIT_SHORT_SHA=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
echo "COMMIT_TIME=${COMMIT_TIME}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Image & Push
uses: netcorext/buildx-image-action@dev
with:
image: netcorext/pev2
tag: ${{ env.COMMIT_TIME }}
tag-hash: ${{ env.COMMIT_SHORT_SHA }}
tag-latest: latest