diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml new file mode 100644 index 0000000..ad5cf02 --- /dev/null +++ b/.github/workflows/build-and-push.yml @@ -0,0 +1,30 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + workflow_dispatch: # Allows manual trigger + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: luciferscircle/redlib:${{ github.sha }} diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml deleted file mode 100644 index 5442775..0000000 --- a/.github/workflows/main-docker.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Container build - -on: - workflow_run: - workflows: ["Release Build"] - types: - - completed -env: - REGISTRY_IMAGE: quay.io/redlib/redlib - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - { platform: linux/amd64, target: x86_64-unknown-linux-musl } - - { platform: linux/arm64, target: aarch64-unknown-linux-musl } - - { platform: linux/arm/v7, target: armv7-unknown-linux-musleabihf } - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - tags: | - type=sha - type=raw,value=latest,enable={{is_default_branch}} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Quay.io Container Registry - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_ROBOT_TOKEN }} - - name: Build and push - id: build - uses: docker/build-push-action@v5 - with: - context: . - platforms: ${{ matrix.platform }} - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - file: Dockerfile - build-args: TARGET=${{ matrix.target }} - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ matrix.target }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - merge: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Download digests - uses: actions/download-artifact@v4.1.7 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - tags: | - type=sha - type=raw,value=latest,enable={{is_default_branch}} - - name: Login to Quay.io Container Registry - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_ROBOT_TOKEN }} - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - # - name: Push README to Quay.io - # uses: christian-korneck/update-container-description-action@v1 - # env: - # DOCKER_APIKEY: ${{ secrets.APIKEY__QUAY_IO }} - # with: - # destination_container_repo: quay.io/redlib/redlib - # provider: quay - # readme_file: 'README.md' - - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml deleted file mode 100644 index c8e8d2a..0000000 --- a/.github/workflows/pull-request.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Pull Request - -env: - CARGO_TERM_COLOR: always - NEXTEST_RETRIES: 10 - -on: - push: - branches: - - 'main' - - pull_request: - branches: - - 'main' - -jobs: - test: - name: cargo test - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - - name: Run cargo nextest - run: cargo nextest run - - format: - name: cargo fmt --all -- --check - runs-on: ubuntu-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install stable toolchain with rustfmt component - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - components: rustfmt - - - name: Run cargo fmt - run: cargo fmt --all -- --check - - clippy: - name: cargo clippy -- -D warnings - runs-on: ubuntu-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install stable toolchain with clippy component - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - components: clippy - - - name: Run cargo clippy - run: cargo clippy -- -D warnings \ No newline at end of file diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml new file mode 100644 index 0000000..3b78075 --- /dev/null +++ b/.github/workflows/sync-fork.yml @@ -0,0 +1,26 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 0 * * *' # Runs daily at midnight + workflow_dispatch: # Allows manual trigger + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout fork + uses: actions/checkout@v3 + with: + ref: main + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Add upstream + run: | + git remote add upstream https://github.com/redlib-org/redlib.git + git fetch upstream + git checkout main + git merge upstream/main --no-ff --no-edit + + - name: Push changes + run: git push origin main diff --git a/README.md b/README.md index 4026791..d36b9d8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +# This Fork +I'm not sure the maintainer of redlib wants random themes added, so until my PR gets approved I just wanted to add my theme "Midnight Purple" to my public redlib instances. + +Instances that will use this image:
+https://reddit.idevicehacked.com
+https://pirate.vodka
+ +original github repo:
+https://github.com/redlib-org/redlib + +my fork for the theme:
+https://github.com/LucifersCircle/redlib
+ +This fork should stay up to date with the official github repo. + # Redlib > An alternative private front-end to Reddit, with its origins in [Libreddit](https://github.com/libreddit/libreddit).