Skip to content

Commit

Permalink
add registry service to allow docker to run
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonfleas committed Feb 27, 2024
1 parent 1d709ef commit 981395c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
matrix:
image_folder: ${{fromJson(needs.create_matrix.outputs.matrix)}}

services:
registry:
image: registry:2
ports:
- 5000:5000

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -28,14 +34,17 @@ jobs:

- name: Set up Docker
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

- name: Build and push to GHA
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image_folder }}/.
tags: ${{ steps.set_image_name.outputs.image_name }}:latest
push: true
tags: localhost:5000/${{ steps.set_image_name.outputs.image_name }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Check build status
run: docker run --rm ${{ steps.set_image_name.outputs.image_name }}:latest
run: docker run --rm localhost:5000/${{ steps.set_image_name.outputs.image_name }}:latest

0 comments on commit 981395c

Please sign in to comment.