diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..3629969 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,57 @@ +name: Docker build and push + +on: + workflow_dispatch: + pull_request: + push: + tags: + - '**' + +jobs: + build-push: + runs-on: ubuntu-latest + steps: + # - name: Maximize build disk space + # uses: easimon/maximize-build-space@v10 + # with: + # remove-dotnet: true + # remove-android: true + # remove-haskell: true + # remove-codeql: true + # remove-docker-images: true + + - name: Resize /dev/shm + run: | + sudo mount -o remount,size=4G /dev/shm + + - name: Mount /var as tmpfs + run: | + sudo mount -t tmpfs -o size=30G tmpfs /var/lib/docker + + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract app's version from info.xml + id: getversion + uses: mavrosxristoforos/get-xml-info@1.0 + with: + xml-file: 'appinfo/info.xml' + xpath: '/info/version' + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/nextcloud/context_chat_backend:latest,ghcr.io/nextcloud/context_chat_backend:${{ steps.getversion.outputs.info }} diff --git a/.github/workflows/max-space.yml b/.github/workflows/max-space.yml new file mode 100644 index 0000000..efba62a --- /dev/null +++ b/.github/workflows/max-space.yml @@ -0,0 +1,32 @@ +name: My build action requiring more space + +on: workflow_dispatch + +jobs: + build: + name: Build my artifact + runs-on: ubuntu-latest + steps: + - name: Free space before + run: | + echo "Free space before:" + df -h + + - name: Maximize build disk space + uses: easimon/maximize-build-space@v10 + with: + # need space in /var for Docker images + root-reserve-mb: 30000 + remove-dotnet: true + remove-android: true + remove-haskell: true + remove-codeql: true + remove-docker-images: true + + - name: Checkout + uses: actions/checkout@v3 + + - name: Free space after + run: | + echo "Free space after:" + df -h