-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: action to build container * feat: verified action works, change the trigger to pr-open * fix: change job name
- Loading branch information
1 parent
26b9326
commit 8c02205
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: build listener image | ||
|
||
# used on push for testing / development | ||
# on: | ||
# push: | ||
# branches: ['master', 'main', 'feat/build-docker'] | ||
|
||
on: | ||
pull_request: | ||
# debug: remove the dev,putting build action on non existent branches for debug | ||
branches: ['main'] | ||
types: ['opened', 'reopened'] | ||
paths-ignore: | ||
- .vscode/** | ||
- .gitignore | ||
- LICENSE | ||
- readme.md | ||
- code_of_conduct.md | ||
- cicd/** | ||
- scripts/** | ||
- .flake8 | ||
- COMPLIANCE.yaml | ||
- requirements-dev.txt | ||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
buildjob: | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
name: 'build federal gov AMQP listener' | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-22.04 | ||
env: | ||
DEBUG_DEPLOY: false | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
id: checkout | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
- name: calculate image tag | ||
id: calculateImageTag | ||
shell: bash | ||
run: | | ||
DATESTAMP=$(date +%Y%m%d-%H%M) | ||
echo datestamp is $DATESTAMP | ||
echo ::set-output name=DATESTAMP::${DATESTAMP} | ||
ls -la | ||
- name: Log in to GitHub Docker Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
#username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Client Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true # Will only build if this is not here | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/datamart_listener:latest | ||
ghcr.io/${{ github.repository_owner }}/datamart_listener:${{ steps.calculateImageTag.outputs.DATESTAMP }} |