-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.17 KB
/
a2cps-cms.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
name: A2CPS CMS Builds
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'a2cps_cms/**'
jobs:
build_commit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: a2cps_cms
steps:
- uses: actions/checkout@v2
- name: Get shortsha
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}
env:
EVENT_SHA: ${{ github.event.client_payload.sha }}
- name: Print shortsha
run: |
echo $SHORTSHA
env:
SHORTSHA: ${{ steps.vars.outputs.sha_short }}
- uses: docker/setup-buildx-action@v2
name: Setup Docker Builds
- uses: docker/login-action@v2
name: Log in to docker
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v3
name: Build & push commit tagged Docker image
with:
context: a2cps_cms
push: true
tags: taccwma/a2cps-cms:${{ steps.vars.outputs.sha_short }}