Skip to content

Commit

Permalink
Add Docker Hub pub on release
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsieurV committed Jul 30, 2022
1 parent 5d956d2 commit d7220b5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
paths-ignore:
- '**.md'
branches:
- master

jobs:
build-ant-test:
Expand All @@ -22,9 +24,6 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: Install tests
# run: ./container/install_tests.sh
# shell: bash
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -34,18 +33,4 @@ jobs:
run: make docker-build-all
- name: Run tests (using locally built Docker images)
run: make test-docker-compose

# TODO Publish images to Docker hub.
# Only on tag or release
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release

# From Travis.yml:
# # Publish images to Docker hub.
# # Only in master branch commits.
# # https://docs.travis-ci.com/user/docker/#pushing-a-docker-image-to-a-registry
# # Could also be done in an after_success, see https://ops.tips/blog/travis-ci-push-docker-image/
# deploy:
# provider: script
# script: bash container/docker_push.sh
# on:
# branch: master

33 changes: 33 additions & 0 deletions .github/workflows/docker-hub-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docker-hub-publish
on:
release:
types: [published]

jobs:
build-ant-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
make install-dev
- name: Build Docker images
run: make docker-build-all
- name: Run tests (using locally built Docker images)
run: make test-docker-compose
- name: Docker Hub push
run: ./container/docker_push.sh
shell: bash
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
2 changes: 0 additions & 2 deletions container/install_tests.sh

This file was deleted.

0 comments on commit d7220b5

Please sign in to comment.