dotnet #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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##*/} |