-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.45 KB
/
build.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
name: Core-Portal Builds
on:
push:
branches:
- [ main, feat/Tapis-v3 ]
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Get shortsha and branch name
uses: actions/checkout@v3
id: vars
run: |
if [ -z "$EVENT_SHA" ]; then SHORT_SHA=${GITHUB_SHA::8}; else SHORT_SHA=${EVENT_SHA::8}; fi
echo ::set-output name=sha_short::${SHORT_SHA}
BRANCH_SHORT=`git symbolic-ref --short HEAD | sed 's/[^[:alnum:]\.\_\-]/-/g'`
echo ::set-output name=branch_short::${BRANCH_SHORT}
env:
EVENT_SHA: ${{ github.event.client_payload.sha }}
- name: Print vars
run: |
echo $SHORTSHA
echo $BRANCH_SHORT
env:
SHORTSHA: ${{ steps.vars.outputs.sha_short }}
BRANCH_SHORT: ${{ steps.vars.outputs.branch_short }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: ./server/conf/docker
file: ./server/conf/docker/Dockerfile
push: true
tags: taccwma/core-portal:${{ steps.vars.outputs.branch_short }},taccwma/core-portal:${{ steps.vars.outputs.sha_short }}