Skip to content

Commit

Permalink
Publish docker on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Félix Bouliane authored and fbouliane committed May 12, 2022
1 parent 0f15010 commit cef936a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,31 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

docker-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: internap/fake-switches
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker build
run: |
docker build . -t internap/fake-switches:latest
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


10 changes: 8 additions & 2 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: Unit tests
on: pull_request
jobs:
build:
python-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -14,7 +14,6 @@ jobs:
tox_env: 'py27'
- python-version: '3.5'
tox_env: 'py35'

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -29,3 +28,10 @@ jobs:
run: |
tox -e ${{ matrix.tox_env }}
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: docker build
run: |
docker build . -t internap/fake-switches:latest

0 comments on commit cef936a

Please sign in to comment.