Actions run on schedule, fix publish

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 66de5b5..d9bdbc0 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -2,6 +2,8 @@
 on:
   push:
   pull_request:
+  schedule:
+  - cron:  '0 8 * * *'
 
 jobs:
   lint:
@@ -127,3 +129,23 @@
       run: python -m tox -e ${{ matrix.tox_env }}
       env:
         UPGRADE_ADVISORY: 'yes'
+
+  publish:
+    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+    needs: [check, test, lint]
+    runs-on: ubuntu-latest
+    steps:
+    - name: setup python to build package
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.8
+    - name: install pep517
+      run: python -m pip install pep517
+    - name: build package
+      run: python -m pep517.build -s -b . -o dist
+    - name: publish to PyPi
+      uses: pypa/gh-action-pypi-publish@master
+      with:
+        skip_existing: true
+        user: __token__
+        password: ${{ secrets.pypi_password }}
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
deleted file mode 100644
index 9002cce..0000000
--- a/.github/workflows/publish.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: publish
-on:
-  push:
-    branches-ignore:
-      - "*"
-    tags:
-      - "*"
-
-jobs:
-  publish:
-    runs-on: ubuntu-latest
-    steps:
-    - name: publish to PyPi
-      uses: pypa/gh-action-pypi-publish@master
-      with:
-        user: __token__
-        password: ${{ secrets.pypi_password }}