diff --git a/.github/workflows/build-arik-container.yml b/.github/workflows/build-arik-container.yml new file mode 100644 index 000000000..9c3a8a33c --- /dev/null +++ b/.github/workflows/build-arik-container.yml @@ -0,0 +1,85 @@ +name: Build ArikTube container + +on: + workflow_dispatch: + push: + branches: + - arik + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + submodules: true + + - name: Install required APT packages + run: sudo apt install -y libsqlite3-dev + + - name: Install Crystal + uses: crystal-lang/install-crystal@v1.9.2 + with: + crystal: 1.20.3 + + - name: Cache Shards + uses: actions/cache@v6 + with: + path: | + ./lib + ./bin + key: shards-${{ hashFiles('shard.lock') }} + + - name: Install Shards + run: | + if ! shards check; then + shards install --skip-postinstall --skip-executables + fi + + - name: Run tests + run: crystal spec + + - name: Build + run: crystal build --warnings all --error-on-warnings --error-trace src/invidious.cr + + build: + needs: test + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to registry + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v6 + with: + images: ghcr.io/neskiredk/invidious + flavor: | + latest=false + tags: | + type=raw,value=latest + type=sha + + - name: Build and push + uses: docker/build-push-action@v7 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64 + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} + build-args: | + "release=1"