From 4a55c6d9abfbf313a12471be3fc7da781e9d089e Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 5 Nov 2023 14:34:15 -0800 Subject: [PATCH 1/4] Adding in a different docker build and push flow --- .github/workflows/docker.yml | 67 ++++++++++++++++++++++++ .github/workflows/dockerbuild.yml | 21 -------- .github/workflows/legacy_dockerbuild.yml | 21 -------- 3 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/dockerbuild.yml delete mode 100644 .github/workflows/legacy_dockerbuild.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..168c8bc --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,67 @@ +# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images +# https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Create and publish a Docker image + +on: + schedule: + # * is a special character in YAML so you have to quote this string + # every Sunday at UTC midnight + - cron: '0 0 * * 0' + push: + branches: [ master ] + # Publish semver tags as releases. + tags: [ '*.*.*' ] + pull_request: + branches: [ master ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - + name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + # linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6 + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml deleted file mode 100644 index e83fd08..0000000 --- a/.github/workflows/dockerbuild.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy to Dockerhub -on: - push: - tags: - - v* -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Check out code - - uses: mr-smithers-excellent/docker-build-push@v5 - name: Build & push Docker image - with: - image: selexin/cleanarr - addLatest: true - registry: docker.io - dockerfile: Dockerfile - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - diff --git a/.github/workflows/legacy_dockerbuild.yml b/.github/workflows/legacy_dockerbuild.yml deleted file mode 100644 index 07011b6..0000000 --- a/.github/workflows/legacy_dockerbuild.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy to Dockerhub -on: - push: - tags: - - v* -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Check out code - - uses: mr-smithers-excellent/docker-build-push@v5 - name: Build & push Docker image - with: - image: selexin/plex-library-cleaner - addLatest: true - registry: docker.io - dockerfile: Dockerfile - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - From d95bfdcf1a4da051b64ee78a32ede435ae4a6a67 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 5 Nov 2023 14:36:56 -0800 Subject: [PATCH 2/4] Adjusting for the different format for versioning --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 168c8bc..06eee58 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,7 +15,7 @@ on: push: branches: [ master ] # Publish semver tags as releases. - tags: [ '*.*.*' ] + tags: [ 'v*.*.*' ] pull_request: branches: [ master ] From 8ce1dfff19ad3d1bb9a0c3389cae1553c5d53b38 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 5 Nov 2023 14:38:57 -0800 Subject: [PATCH 3/4] Restrict the archs for now too --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 06eee58..9074b2e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,7 +59,7 @@ jobs: with: context: . # linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6 - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 5ecd1f5e79427bda077b34e9170ab752ad47ddcf Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Sun, 5 Nov 2023 14:51:17 -0800 Subject: [PATCH 4/4] Curious --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0dabcaf..f09797a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV REACT_APP_BACKEND_URL="/" RUN yarn install && yarn build -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 ENV STATIC_INDEX 1 ENV CONFIG_DIR "/config"