mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2026-09-11 11:15:54 +00:00
Use local Docker registry in GitHub Action
The tests container copies files from the build containers. In order for this to work in the GitHub actions workflow, the build images need to be uploaded to a local Docker registry first.
This commit is contained in:
@@ -9,36 +9,48 @@ jobs:
|
||||
build-and-test:
|
||||
name: Build curl-impersonate and run the tests
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
# A local registry is needed to push the build images to because we use
|
||||
# the 'docker-container' driver. See
|
||||
# https://github.com/docker/buildx/issues/301
|
||||
# and
|
||||
# See https://github.com/docker/build-push-action/blob/master/docs/advanced/local-registry.md
|
||||
registry:
|
||||
image: registry:2
|
||||
ports:
|
||||
- 5000:5000
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
- name: Build the Chrome version of curl-impersonate
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: false
|
||||
load: true
|
||||
push: true
|
||||
context: chrome/
|
||||
tags: curl-impersonate-chrome:latest
|
||||
tags: localhost:5000/curl-impersonate/chrome
|
||||
|
||||
- name: Build the Firefox version of curl-impersonate
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: false
|
||||
load: true
|
||||
push: true
|
||||
context: firefox/
|
||||
tags: curl-impersonate-firefox:latest
|
||||
tags: localhost:5000/curl-impersonate/ff
|
||||
|
||||
- name: Build the tests container
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: false
|
||||
load: true
|
||||
context: tests/
|
||||
tags: curl-impersonate-tests:latest
|
||||
build-args: |
|
||||
FIREFOX_IMAGE=localhost:5000/curl-impersonate/ff
|
||||
CHROME_IMAGE=localhost:5000/curl-impersonate/chrome
|
||||
|
||||
- name: Run the tests
|
||||
run: docker run --rm curl-impersonate-tests --log-cli-level DEBUG
|
||||
|
||||
Reference in New Issue
Block a user