Skip to content

Commit

Permalink
Decoupling the image build process from the flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilan Zuckerman committed Apr 21, 2021
1 parent 5d9f9a6 commit cbb44eb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

jobs:
build:
env:
context: beyond
image_name: beyond
runs-on: ubuntu-18.04
steps:
- name: Checkout source tree
Expand Down Expand Up @@ -35,8 +38,27 @@ jobs:
tar -xzf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver
pip install -r tests/requirements-test.txt
- name: Build the docker-compose stack
run: docker-compose up -d
# - name: Build the docker-compose stack
# run: docker-compose up -d

- name: Check and verify version.json
id: check_version
run: |
echo -n ::set-output name=IMAGE_TAGS::
echo $(jq -r '.version' version.json)
- name: Build image
uses: docker/build-push-action@v1
with:
path: .
push: false
repository: ${{ env.image_name }}
tags: ${{ steps.check_version.outputs.IMAGE_TAGS }}

- name: Test image
run: |
echo "Running: docker run -d -p 5000:5000 --name ${image_name} ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }}"
docker run -d -p 5000:5000 --name ${image_name} ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }}
- name: Execute tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ COPY . .
RUN pip3 install -r requirements.txt
EXPOSE 5000

ENTRYPOINT python3 app.py runserver > web-application.log
ENTRYPOINT python3 app.py runserver > web-application.log
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.9'
services:
beyond:
build: .
image: quay.io/redhat-beyond/beyond
container_name: beyond
ports:
- "5000:5000"
Expand Down
1 change: 1 addition & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"v1.0.0"}

0 comments on commit cbb44eb

Please sign in to comment.