Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz1273327 committed Jul 26, 2021
1 parent 87e1dae commit c080baa
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 86 deletions.
80 changes: 0 additions & 80 deletions .github/workflows/python-package-master.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Python package

on:
push:
branches: [dev]
branches: [master,dev]
pull_request:
branches: [master]

jobs:
check:
Expand All @@ -32,4 +34,4 @@ jobs:
pycodestyle --max-line-length=140 --ignore=E501 --first --statistics portainer_deploy_tool
- name: Type Hint Check
run: |
mypy --install-types --non-interactive --ignore-missing-imports --show-column-numbers --follow-imports=silent --check-untyped-defs --disallow-untyped-defs --no-implicit-optional --warn-unused-ignores portainer_deploy_tool
mypy --install-types --non-interactive --ignore-missing-imports --show-column-numbers --follow-imports=silent --check-untyped-defs --disallow-untyped-defs --no-implicit-optional --warn-unused-ignores portainer_deploy_tool
47 changes: 43 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ on:
types: [created]

jobs:
deploy:

build_and_pub_to_pypi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -37,4 +35,45 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run:
twine upload dist/*
twine upload dist/*
docker-build:
needs: build_and_pub_to_pypi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_HUB_USER }}/${GITHUB_REPOSITORY#*/}
VERSION=${GITHUB_REF/refs\/tags\//}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest"
# Set output parameters.
echo ::set-output name=tags::${TAGS}
echo ::set-output name=docker_image::${DOCKER_IMAGE}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }}

- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}

0 comments on commit c080baa

Please sign in to comment.