diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..6af4b81 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,66 @@ +name: Build and push image + +on: + push: + branches: [main] + +jobs: + build-containers: + runs-on: ubuntu-latest + env: + DOCKER_ORG: eising + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + + - name: Login to Registry + uses: docker/login-action@v2 + with: + registry: git.eising.cloud # replace it with your local IP + username: ${{ gitea.actor }} + password: ${{ secrets.MY_GITEA_TOKEN }} + + - name: Get Meta + id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + echo ${{ gitea.actor }} + echo ${{ gitea.token }} + + - name: Build backend and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./docker/Dockerfile.backend + platforms: | + linux/amd64 + push: true + tags: | + git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-backend:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }} + + + - name: Build backend and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./docker/Dockerfile.sshd + platforms: | + linux/amd64 + push: true + tags: | + git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-sshd:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }} + + - name: Build backend and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./docker/Dockerfile.admin + platforms: | + linux/amd64 + push: true + tags: | + git.eising.cloud/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}-admin:${{ gitea.ref == 'refs/heads/main' && 'latest' || gitea.sha }}