owltide/.forgejo/workflows/build.yaml
Hornwitser e52972853d License under AGPL version 3 or later
I firmly believe in free software.

The application I'm making here have capabilities that I've not seen in
any system.  It presents itself as an opportunity to collaborate on a
tool that serves the people rather than corporations.  Whose incentives
are to help people rather, not make the most money.  And whose terms
ensure that these freedoms and incentives cannot be taken back or
subverted.

I license this software under the AGPL.
2025-06-30 18:58:24 +02:00

55 lines
1.9 KiB
YAML

# SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
# SPDX-License-Identifier: AGPL-3.0-or-later
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: Write build info
shell: bash
run: |
cat > ${{ github.workspace }}/shared/utils/build-info.ts <<EOF
export const BUILDER = "forgejo-runner";
export const GIT_REF = "${{ github.ref_name }}";
export const GIT_SHA = "${{ github.sha }}";
EOF
-
name: Build and push
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.FULLA_WEBHOOK_SERVICE_SECRET }}" \
--data action=restart \
--data service=schedule-demo \
--fail-with-body \
"http://fulla.hz.hornwitser.no:9000/hooks/service"