-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial docker compose build github action
- Loading branch information
Showing
2 changed files
with
71 additions
and
1 deletion.
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,68 @@ | ||
name: Build Docker image | ||
# Shamelessly cribbed from https://docs.docker.com/build/ci/github-actions/test-before-push/ | ||
# with minor modifications | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
TEST_TAG: user/app:test | ||
LATEST_TAG: user/app:latest | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run docker-compose | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: "./docker-compose.yml" | ||
services: "tom" | ||
up-flags: "--remove-orphans" | ||
|
||
- name: Test | ||
run: docker run --network tom_desc_default appropriate/curl -s --retry 10 --retry-connrefused http://tom:8080/ | ||
|
||
# test2: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# #container_dir: [ docker_kafka, docker_postgres, docker_server] | ||
# container_dir: [ docker_kafka] | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Set up Docker Buildx | ||
# id: buildx | ||
# uses: docker/setup-buildx-action@master | ||
|
||
# - name: Cache Docker layers | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: /tmp/.buildx-cache | ||
# key: ${{ runner.os }}-buildx-${{matrix.container_dir}}-${{ github.sha }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-buildx-${{matrix.container_dir}} | ||
|
||
# - name: Build and push images | ||
# uses: docker/build-push-action@v2 | ||
# with: | ||
# push: false | ||
# load: true | ||
# builder: ${{ steps.buildx.outputs.name }} | ||
# tags: repo/${{matrix.container_dir}}:latest | ||
# file: ${{matrix.container_dir}}/Dockerfile | ||
# context: . | ||
# cache-from: type=local,src=/tmp/.buildx-cache | ||
# cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
# stack: | ||
# needs: test2 | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Build the stack | ||
# run: COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build |
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