Skip to content

Commit

Permalink
Update docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0golovatyi authored Oct 7, 2020
1 parent 224488d commit dfc1054
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,22 @@
name: Docker
name: Publish Docker Image for Release

on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master

# Publish `v1.2.3` tags as releases.
tags:
- v*

# Run tests for any PRs.
pull_request:

release:
types: [released]

env:
IMAGE_NAME: tabpy

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.
# See also https://docs.docker.com/docker-hub/builds/
name: Push Docker image to GitHub Packages
push:
# Ensure test job passes before pushing image.
needs: test

runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2
- name: Checkout the repo
uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
Expand Down

0 comments on commit dfc1054

Please sign in to comment.