-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.08 KB
/
apcd-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
name: APCD CMS Builds
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "apcd_cms/**"
jobs:
build_commit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apcd_cms
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set shortsha and branch environment variables
id: vars
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF_NAME} | sed 's/[^[:alnum:]\.\_\-]/-/g')" >> "$GITHUB_OUTPUT";
echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT";
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push commit tagged Docker image
uses: docker/build-push-action@v5
with:
context: apcd_cms
push: true
tags: taccwma/apcd-cms:${{ steps.vars.outputs.SHORT_SHA }},taccwma/apcd-cms:${{ steps.vars.outputs.BRANCH_NAME }}