Merge pull request #7219 from sjackman/docker-action

.github/workflows/tests.yml: Deploy Docker image
This commit is contained in:
Shaun Jackman 2020-03-26 09:52:00 -07:00 committed by GitHub
commit 0fd66ee398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,9 @@ on:
push:
branches: master
pull_request: []
release:
types:
- published
jobs:
tests:
if: github.repository == 'Homebrew/brew'
@ -140,6 +143,22 @@ jobs:
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker-compose -f Dockerfile.yml run --rm -v $GITHUB_WORKSPACE:/tmp/test-bot sut
docker tag homebrew_sut brew
else
brew test-bot
fi
- name: Deploy the latest Docker image
if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/master'
run: |
docker login docker.pkg.github.com -u BrewTestBot -p ${{secrets.GITHUB_TOKEN}}
docker tag brew docker.pkg.github.com/homebrew/brew/brew
docker push docker.pkg.github.com/homebrew/brew/brew
- name: Deploy the tagged Docker image
if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/')
run: |
docker login docker.pkg.github.com -u BrewTestBot -p ${{secrets.GITHUB_TOKEN}}
v=${GITHUB_REF:10}
docker tag brew "docker.pkg.github.com/homebrew/brew/brew:$v"
docker push "docker.pkg.github.com/homebrew/brew/brew:$v"