Improve GH action build time
Tests are redundant because right now it's just making sure the image can build. But if the image _can't_ build, it'll fail the second time around as well, making the first "test" redundant.
This commit is contained in:
parent
086e13cbaf
commit
cc22b4bdf9
20
.github/workflows/dockerpublish.yml
vendored
20
.github/workflows/dockerpublish.yml
vendored
@ -18,29 +18,9 @@ env:
|
|||||||
IMAGE_NAME: shynet
|
IMAGE_NAME: shynet
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Run tests.
|
|
||||||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
if [ -f docker-compose.test.yml ]; then
|
|
||||||
docker-compose --file docker-compose.test.yml build
|
|
||||||
docker-compose --file docker-compose.test.yml run sut
|
|
||||||
else
|
|
||||||
docker build . --file Dockerfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Push image to GitHub Packages.
|
# Push image to GitHub Packages.
|
||||||
# See also https://docs.docker.com/docker-hub/builds/
|
# See also https://docs.docker.com/docker-hub/builds/
|
||||||
push:
|
push:
|
||||||
# Ensure test job passes before pushing image.
|
|
||||||
needs: test
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user