diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..8cd3c2f --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build + +on: + push: + branches: + - 'main' + +jobs: + build: + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Extract Version Tag + id: extract-version + run: echo "docker_tag=$(grep -oP '(?<=FROM nextcloud:)[0-9]+\.[0-9]+\.[0-9]+' Dockerfile)" >> $GITHUB_OUTPUT + shell: bash + + - name: Install Docker + run: | + apt-get update + apt-get install docker.io -y + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host + platforms: linux/amd64,linux/arm64 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build image + uses: docker/build-push-action@v2 + with: + push: true + tags: jiriks74/nextcloud-extended:${{ steps.extract-version.outputs.docker_tag }},jiriks74/nextcloud-extended:latest + platforms: linux/amd64,linux/arm64 + context: . + file: ./Dockerfile + + # - name: Build image + # uses: docker/build-push-action@v2 + # with: + # push: true + # tags: + # jiriks74/nextcloud-extended:latest + # platforms: linux/amd64,linux/arm64 + # context: . + # file: ./Dockerfile + + # - name: Tag latest + # run: | + # docker image ls + # docker tag nextcloud-extended:${{ steps.extract-version.outputs.docker_tag }} nextcloud-extended:latest + # docker push nextcloud-extended:latest