diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml deleted file mode 100644 index b7069f2..0000000 --- a/.github/workflows/code-analysis.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Lint -on: - push: - branches: - - main - pull_request: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint: - name: ESLint - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Download deps - uses: bahmutov/npm-install@v1 - - - name: Lint - run: npm run lint - - prettier: - name: Prettier - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Download deps - uses: bahmutov/npm-install@v1 - - - name: Prettier check - run: npm run format:check diff --git a/.github/workflows/docker.chatgpt-lite.yml b/.github/workflows/docker.chatgpt-lite.yml deleted file mode 100644 index b2372b0..0000000 --- a/.github/workflows/docker.chatgpt-lite.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish blrchen/chatgpt-lite - -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - build_and_push_image: - name: Push image to Docker Hub - 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: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: blrchen/chatgpt-lite - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..0b4dc74 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,59 @@ +name: Build notebook +on: + push: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout notebook + uses: actions/checkout@v3 + + - name: Log in to registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate tags and labels + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Check Free Space 0 + run: | + echo "Free space:" + df -h + + - name: Docker/ENV cleanup Cleanup + run: | + docker image prune -a -f + docker container prune -f + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Check Free Space 1 + run: | + echo "Free space:" + df -h + + - name: Build and push notebook + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}