diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml new file mode 100644 index 0000000..c46c255 --- /dev/null +++ b/.github/workflows/docker-build-publish.yml @@ -0,0 +1,81 @@ +name: Docker Build and Publish + +on: + push: + # Publish semver tags as releases. + tags: [ 'v*' ] # Push events to matching v*, i.e. v1.0, v1.0.1 + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # Base Image Version to use + BASE_IMAGE_VERSION: v2.2.0 + # Tag Version which triggered the build + IMAGE_TAG: ${{ github.ref_name }} + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + cmd: + - arch: arm32v6 + platforms: linux/arm/v6 + - arch: arm64v8 + platforms: linux/arm64/v8 + - arch: amd64 + platforms: linux/amd64 + + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + #- name: Login to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Lower case repository name + run: | + echo "IMAGE_REPO=${REPO,,}" >>${GITHUB_ENV} + env: + REPO: '${{ github.repository }}' + + - name: Build and push Docker images + id: build-and-push + run: | + docker buildx build . -f Dockerfile --platform ${{ matrix.cmd.platforms }} --push \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:${{ matrix.cmd.arch }}-${{ env.IMAGE_TAG }} \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:${{ matrix.cmd.arch }}-latest \ + --build-arg FROM_IMAGE=certbot/certbot:${{ matrix.cmd.arch }}-${{ env.BASE_IMAGE_VERSION }} + + - name: Sleep for 30 seconds + run: sleep 30s + shell: bash + + - name: Link to latest tag + id: link-tag + run: | + docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:latest \ + --amend ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:amd64-latest \ + --amend ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:arm32v6-latest \ + --amend ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:arm64v8-latest + docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:latest diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e903be3..fd427ac 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest environment: desec-test-account strategy: + fail-fast: false # You can use PyPy versions in python-version. # For example, pypy2 and pypy3 matrix: @@ -22,12 +23,10 @@ jobs: '3.11', ] certbot-version: [ - # TODO at the time of writing, versions earlier than 1.14, including '0.40.0', the latest version for Ubuntu - # 20.04, are broken because ImportError: cannot import name 'IO' from 'acme.magic_typing' - # (venv/lib/python3.8/site-packages/acme/magic_typing.py) - '1.14.0', + '1.21.0', '1.32.0', '2.0.0', + '2.6.0', ] steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1db8a87..702333d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false # You can use PyPy versions in python-version. # For example, pypy2 and pypy3 matrix: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dbe2ecb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +ARG FROM_IMAGE=certbot/certbot:amd64-v2.6.0 + +#Base +FROM ${FROM_IMAGE} + +# Install the DNS plugin +COPY . /app +WORKDIR /app +RUN set -ex && \ + pip install -r requirements.txt && \ + pip install . + +RUN rm -rf /app + +#RUN pip install certbot-dns-desec