diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..9074b2e --- /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: [ 'v*.*.*' ] + 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 + 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 }} - 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"