Skip to content

Commit

Permalink
Feat/build docker (#18)
Browse files Browse the repository at this point in the history
* feat: action to build container

* feat: verified action works, change the trigger to pr-open

* fix: change job name
  • Loading branch information
franTarkenton authored Apr 12, 2023
1 parent 26b9326 commit 8c02205
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build_docker_image.yaml
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 }}

0 comments on commit 8c02205

Please sign in to comment.