diff --git a/.gitea/workflows/build-docker.yml b/.gitea/workflows/build-docker.yml deleted file mode 100644 index 85c5519..0000000 --- a/.gitea/workflows/build-docker.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: SharePulse docker image build - -on: - push: - tags: - - 'v*' - -jobs: - build-docker-image: - needs: build-jar - runs-on: ubuntu-22.04 - steps: - - name: Extract tag name - id: get_tag - run: | - TAG_NAME=$(echo $GITEA_REF | sed -n 's/refs\/tags\/v\([0-9.]*\)/\1/p') - if [ -z "$TAG_NAME" ]; then - echo "Tag does not start with 'v', skipping..." - exit 78 # Exiting with specific status to mark job as skipped - fi - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - - - name: Initialize Docker runtime - run: | - apt-get update - apt-get install ca-certificates curl gnupg lsb-release -y - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - chmod a+r /etc/apt/keyrings/docker.gpg - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y - - - name: Checkout - uses: actions/checkout@v4 - - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: jar-artifact - path: build/libs - - - name: Build Docker Image - run: docker build . -t walzen665/sharepulse:latest - - - name: Tag Docker image - run: docker tag walzen665/sharepulse:latest git.walzen665.de/walzen665/sharepulse:latest - - - name: Log in to Gitea Docker Registry - run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de - - - name: Push Docker Image to Gitea - run: docker push git.walzen665.de/walzen665/sharepulse:latest \ No newline at end of file diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8acbe81..d7a36ff 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -41,4 +41,55 @@ jobs: uses: actions/upload-artifact@v3 with: name: jar-artifact - path: build/libs/*.jar \ No newline at end of file + path: build/libs/*.jar + + build-docker-image: + runs-on: ubuntu-22.04 + needs: build-jar + steps: + - name: Extract tag name + id: get_tag + run: | + TAG_NAME=$(echo $GITEA_REF | sed -n 's/refs\/tags\/v\([0-9.]*\)/\1/p') + if [ -z "$TAG_NAME" ]; then + echo "Tag does not start with 'v', skipping..." + exit 78 # Exiting with specific status to mark job as skipped + fi + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV + + - name: Initialize Docker runtime + run: | + apt-get update + apt-get install ca-certificates curl gnupg lsb-release -y + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + chmod a+r /etc/apt/keyrings/docker.gpg + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + $(lsb_release -cs) stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update + apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y + + - name: Checkout + uses: actions/checkout@v4 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: jar-artifact + path: build/libs + + - name: Build Docker Image + run: docker build . -t walzen665/sharepulse:latest + + - name: Tag Docker image + run: docker tag walzen665/sharepulse:latest git.walzen665.de/walzen665/sharepulse:latest + + - name: Log in to Gitea Docker Registry + run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de + + - name: Push Docker Image to Gitea + run: docker push git.walzen665.de/walzen665/sharepulse:latest + +