From a3d14ef71d04d4d96c8d20a7345bc21c91583d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 19 Sep 2023 19:12:38 +0200 Subject: [PATCH] feat(workflow-build): add automatized build on push --- .gitea/workflows/build.yml | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/build.yml 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