owltide/.forgejo/workflows/build.yaml
Hornwitser 81de90d4a6
All checks were successful
/ build (push) Successful in 1m10s
/ deploy (push) Successful in 15s
Push container images to a private org
The access permissions in Forgejo does not allow making packages
of a user private, the only options are hide the user completely
or make packages public.  Do a workaround for this by pushing to
a private org.
2025-05-19 18:55:59 +02:00

44 lines
1.4 KiB
YAML

on:
push:
branches:
- develop
env:
REGISTRY_IMAGE: ${{ vars.REGISTRY }}/private/schedule-demo:${{ github.ref_name }}
jobs:
build:
runs-on: docker
container:
image: forge.hornwitser.no/public/builder:r2025.5.2
steps:
-
name: Authenticate with registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | podman login ${{ vars.REGISTRY }} --username runner --password-stdin
-
name: Checkout repository
run: |
git config --global credential.helper store
echo "https://runner:${{ secrets.GITHUB_TOKEN }}@$(echo "${{ github.server_url }}" | cut -b 9-)" > ~/.git-credentials
git clone --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}
-
name: Build and push
shell: bash
run: |
podman build --tag ${{ env.REGISTRY_IMAGE }} ${{ github.workspace }}
podman push ${{ env.REGISTRY_IMAGE }}
deploy:
if: github.ref_name == 'develop'
runs-on: docker
needs: build
container:
image: forge.hornwitser.no/public/builder:r2025.5.2
steps:
-
name: Restart deployment
run: |
curl --silent \
--header "X-Secret: ${{ secrets.SERVICE_WEBHOOK_SECRET }}" \
--data action=restart \
--data service=schedule-demo \
"http://fulla.hz.hornwitser.no:9000/hooks/service"