-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (51 loc) · 1.71 KB
/
build-push-common.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
60
61
62
63
64
name: diam-common
on:
push:
branches: [jess-admin-tool]
paths:
- "backend/common/**"
- ".github/workflows/build-push-common.yml"
workflow_dispatch:
env:
IMAGE_NAME: common
WORKING_DIRECTORY: ./backend
BRANCH_NAME: develop
VALUES_FILE: dev
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Set environment for branch
run: |
if [[ ${{ github.ref_name }} == 'main' ]]; then
echo "BRANCH_NAME=main" >> "$GITHUB_ENV"
echo "VALUES_FILE=prod" >> "$GITHUB_ENV"
fi
if [[ ${{ github.ref_name }} == 'test' ]]; then
echo "BRANCH_NAME=test" >> "$GITHUB_ENV"
echo "VALUES_FILE=test" >> "$GITHUB_ENV"
fi
if [[ ${{ github.ref_name }} == 'develop' ]]; then
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV"
echo "VALUES_FILE=dev" >> "$GITHUB_ENV"
fi
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Branch name
run: echo running on branch ${GITHUB_REF##*/}
- name: Login to Artifactory
uses: docker/login-action@v1
with:
registry: artifacts.developer.gov.bc.ca
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Dotnet Pack
run: |
dotnet pack -c Release
#- name: Docker Push to Artifactory
# run: |
# docker push artifacts.developer.gov.bc.ca/de27-common/${{env.IMAGE_NAME}}:${GITHUB_REF##*/}