Skip to content

Commit

Permalink
feat: add docker build test
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Jun 27, 2024
1 parent 348e892 commit f40b557
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Build & Run

on:
push:
branches: [develop, main]
pull_request:
branches:
- "**"
workflow_dispatch:
branches:
- "**"

jobs:
docker:
name: Build and run for sanity check leader and worker docker images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build leader docker container
run: |
docker build --progress plain -t leader:${{ github.ref_name }} -f leader.Dockerfile .
- name: Run leader docker container
run: |
docker run -it leader:${{ github.ref_name }} --help
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: Docker_build_push
name: Docker Build & Push

on:
push:
branches: [develop]
branches: [develop, main]
release:
types: [created]
# TODO to debug build and push, remove before merge
pull_request:
branches: [develop]




env:
REGISTRY: ghcr.io
IMAGE_NAME_LEADER: ${{ github.repository }}-leader
IMAGE_NAME_WORKER: ${{ github.repository }}-worker

jobs:
docker:
name: Build and push leader and worker docker image to GitHub Container Registry
name: Build and push leader and worker docker images to GitHub Container Registry
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -42,7 +45,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LEADER }}, enable=true
name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LEADER }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -66,7 +69,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_WORKER }}, enable=false
name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_WORKER }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down

0 comments on commit f40b557

Please sign in to comment.