diff --git a/.gitea/workflows/build_container.yml b/.gitea/workflows/build_container.yml new file mode 100644 index 0000000..a15953d --- /dev/null +++ b/.gitea/workflows/build_container.yml @@ -0,0 +1,80 @@ +name: build_push_container + +on: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + # container: ghcr.io/catthehacker/ubuntu:act-latest + env: + DOCKER_ORG: teacup + DOCKER_LATEST: nightly + RUNNER_TOOL_CACHE: /toolcache + strategy: + matrix: + os: [latest] + steps: + - name: "Build: checkout" + uses: actions/checkout@v4 + + - name: "Build: set up Docker buildx" + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + + - name: "Build: login to registry" + uses: docker/login-action@v3 + with: + registry: https://${{ secrets.MY_REGISTRY }} + username: ${{ secrets.MY_REGISTRY_USERNAME }} + password: ${{ secrets.MY_REGISTRY_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.MY_REGISTRY }}/${{ github.repository }} + + - name: Set Image Name + env: + myTITLE: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.title'] }} + id: split + run: echo "myTITLE=${myTITLE##*d_}" | tee -a "$GITHUB_ENV" + + # - name: Show Image Name + # run: echo ${{ env.myTITLE }} + + - name: "Build: build and push dockerimage" + uses: docker/build-push-action@v5 + with: + build-args: | + VERSION=${{ matrix.os }} + NAS_USER=dnke + context: . + push: true + tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }} + labels: ${{ steps.meta.outputs.labels }} + + - name: "Build: build and push dockerimage" + uses: docker/build-push-action@v5 + with: + build-args: | + VERSION=${{ matrix.os }} + NAS_USER=dnke + context: . + push: true + tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:${{ matrix.os }} + labels: ${{ steps.meta.outputs.labels }} + + - name: "Build: build and push dockerimage" + uses: docker/build-push-action@v5 + with: + build-args: | + VERSION=${{ matrix.os }} + NAS_USER=dnke + context: . + push: true + tags: ${{ secrets.MY_REGISTRY }}/${{ secrets.MY_REGISTRY_USERNAME }}/${{ env.myTITLE }}:latest + labels: ${{ steps.meta.outputs.labels }} +