diff --git a/.gitea/workflows/build-and-push-shulker.yml b/.gitea/workflows/build-and-push-shulker.yml new file mode 100644 index 0000000..0fc4256 --- /dev/null +++ b/.gitea/workflows/build-and-push-shulker.yml @@ -0,0 +1,41 @@ +name: Build and Push Shulker Image + +on: + push: + branches: [ main ] + workflow_dispatch: {} + +jobs: + build: + # Make sure this matches your runner label (e.g., ubuntu-latest, ubuntu-general, self-hosted) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set image tags + id: meta + run: | + IMAGE="${{ secrets.REGISTRY_HOST }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ secrets.IMAGE_NAME }}" + echo "image=${IMAGE}" >> $GITHUB_OUTPUT + echo "tag_latest=${IMAGE}:latest" >> $GITHUB_OUTPUT + echo "tag_sha=${IMAGE}:${GITHUB_SHA}" >> $GITHUB_OUTPUT + + - name: Docker login (Gitea registry) + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${{ secrets.REGISTRY_HOST }}" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + + - name: Build image + run: | + docker build \ + -f docker/shulker/Dockerfile \ + -t "${{ steps.meta.outputs.tag_latest }}" \ + -t "${{ steps.meta.outputs.tag_sha }}" \ + . + + - name: Push image + run: | + docker push "${{ steps.meta.outputs.tag_latest }}" + docker push "${{ steps.meta.outputs.tag_sha }}"