diff --git a/.github/workflows/image-tag.yml b/.github/workflows/dockerhub-container-tagged.yml similarity index 98% rename from .github/workflows/image-tag.yml rename to .github/workflows/dockerhub-container-tagged.yml index 4995671a..7ea1dfb1 100644 --- a/.github/workflows/image-tag.yml +++ b/.github/workflows/dockerhub-container-tagged.yml @@ -1,4 +1,4 @@ -name: Build and Push > Docker Hub Container Repo +name: Build and Push > Docker Hub Container Repo by Tag on: push: diff --git a/.github/workflows/image-javascript.yml b/.github/workflows/image-javascript.yml deleted file mode 100644 index 99eaba8a..00000000 --- a/.github/workflows/image-javascript.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Javascript/Webdriver support - Test, build and push to Docker Hub :javascript tag - -on: - push: - branches: [ javascript-browser ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Create release metadata - run: | - # COPY'ed by Dockerfile into changedetectionio/ of the image, then read by the server in store.py - echo ${{ github.sha }} > changedetectionio/source.txt - echo ${{ github.ref }} > changedetectionio/tag.txt - - - name: Test with pytest - run: | - # Each test is totally isolated and performs its own cleanup/reset - cd changedetectionio; ./run_all_tests.sh - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - version: latest - driver-opts: image=moby/buildkit:master - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: | - ${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io:javascript-dev - platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Image digest - run: echo step SHA ${{ steps.vars.outputs.sha_short }} tag ${{steps.vars.outputs.tag}} branch ${{steps.vars.outputs.branch}} digest ${{ steps.docker_build.outputs.digest }} - -# failed: Cache service responded with 503 -# - name: Cache Docker layers -# uses: actions/cache@v2 -# with: -# path: /tmp/.buildx-cache -# key: ${{ runner.os }}-buildx-${{ github.sha }} -# restore-keys: | -# ${{ runner.os }}-buildx- - - diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml deleted file mode 100644 index 10288ffc..00000000 --- a/.github/workflows/image.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Test, build and push to Docker Hub - -on: - push: - branches: [ master, arm-build ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Create release metadata - run: | - # COPY'ed by Dockerfile into changedetectionio/ of the image, then read by the server in store.py - echo ${{ github.sha }} > changedetectionio/source.txt - echo ${{ github.ref }} > changedetectionio/tag.txt - - - name: Test with pytest - run: | - # Each test is totally isolated and performs its own cleanup/reset - cd changedetectionio; ./run_all_tests.sh - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - version: latest - driver-opts: image=moby/buildkit:master - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: | - ${{ secrets.DOCKER_HUB_USERNAME }}/changedetection.io - platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Image digest - run: echo step SHA ${{ steps.vars.outputs.sha_short }} tag ${{steps.vars.outputs.tag}} branch ${{steps.vars.outputs.branch}} digest ${{ steps.docker_build.outputs.digest }} - -# failed: Cache service responded with 503 -# - name: Cache Docker layers -# uses: actions/cache@v2 -# with: -# path: /tmp/.buildx-cache -# key: ${{ runner.os }}-buildx-${{ github.sha }} -# restore-keys: | -# ${{ runner.os }}-buildx- - - diff --git a/.github/workflows/test-only.yml b/.github/workflows/test-only.yml index 000f2e8a..57e47cf8 100644 --- a/.github/workflows/test-only.yml +++ b/.github/workflows/test-only.yml @@ -4,7 +4,7 @@ name: ChangeDetection.io Test on: [push, pull_request] jobs: - build: + test-build: runs-on: ubuntu-latest steps: @@ -43,4 +43,7 @@ jobs: curl http://127.0.0.1:10000/static/styles/pure-min.css >/dev/null killall -9 changedetection.io + # https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md ? + # https://github.com/docker/buildx/issues/59 ? Needs to be one platform? + # https://github.com/docker/buildx/issues/495#issuecomment-918925854 diff --git a/requirements.txt b/requirements.txt index f37bfff6..36fe5a5e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,10 @@ jsonpath-ng ~= 1.5.3 # Notification library apprise ~= 0.9 +# Pinned version of cryptography otherwise +# ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly +cryptography ~= 3.4 + # Used for CSS filtering, replace with soupsieve and lxml for xpath bs4