# Forgejo Actions — bouw + push image bij elke tag-push # # Activeert wanneer je `git push --tags` doet met een v*-tag. # Bakt de tag in als SU_VERSION zodat het image z'n eigen versie kent. # # Vereisten in Forgejo: # Settings → Variables → REGISTRY=git.example.com, OWNER=bes-r # Settings → Secrets → PACKAGE_TOKEN= name: Build and push image on: push: tags: - "v*" jobs: build: runs-on: docker steps: - name: Checkout uses: actions/checkout@v4 - name: Extract versie uit tag id: tag run: echo "v=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT - name: Login op Forgejo registry run: | echo "${{ secrets.PACKAGE_TOKEN }}" \ | docker login ${{ vars.REGISTRY }} \ -u ${{ vars.OWNER }} \ --password-stdin - name: Bouw image met versie ingebakken run: | docker build \ --build-arg SU_VERSION=${{ steps.tag.outputs.v }} \ -t ${{ vars.REGISTRY }}/${{ vars.OWNER }}/server-up:${{ steps.tag.outputs.v }} \ -t ${{ vars.REGISTRY }}/${{ vars.OWNER }}/server-up:latest \ . - name: Push image run: | docker push ${{ vars.REGISTRY }}/${{ vars.OWNER }}/server-up:${{ steps.tag.outputs.v }} docker push ${{ vars.REGISTRY }}/${{ vars.OWNER }}/server-up:latest