owltide/.forgejo/workflows/build.yaml
Hornwitser 5f455abf4d
Some checks failed
/ build (push) Failing after 1m5s
/ deploy (push) Has been skipped
Try again
2025-05-18 17:27:23 +02:00

71 lines
1.9 KiB
YAML

on:
push:
branches:
- test
env:
REGISTRY: forge.hornwitser.no
REGISTRY_IMAGE: forge.hornwitser.no/hornwitser/schedule-demo
jobs:
build:
runs-on: debian
container:
image: forge.hornwitser.no/hornwitser/builder:test@sha256:8458ed6dd328b1306918a45189dcb1803adade791f7040f03eff4a0c14ea21f9
steps:
-
name: debug
shell: bash
run: |
apt info podman-docker
type docker
-
name: Authenticate
uses: docker/login-action@v3
with:
username: runner
password: ${{ secrets.REGISTRY_TOKEN }}
registry: ${{ env.REGISTRY }}
-
name: Get commit info
id: info
shell: bash
run: |
tee -a ${GITHUB_OUTPUT} <<EOF
DEPLOY_IMAGE=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
DEPLOY_BRANCH=${{ github.ref_name }}
EOF
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ env.REGISTRY_IMAGE }}:latest
outputs:
DEPLOY_IMAGE: ${{ steps.info.outputs.DEPLOY_IMAGE }}
DEPLOY_BRANCH: ${{ steps.info.outputs.DEPLOY_BRANCH }}
deploy:
runs-on: docker
needs: build
container:
image: forge.hornwitser.no/hornwitser/builder:test
steps:
-
name: Check info
run: |
echo DEPLOY_IMAGE=${{ needs.build.outputs.DEPLOY_IMAGE }}
echo DEPLOY_BRANCH=${{ needs.build.outputs.DEPLOY_BRANCH }}
-
name: Configure kubectl
run: |
mkdir -p ~/.kube
cat > ~/.kube/config <<"EOF"
${{ secrets.KUBECONFIG_CONTENT }}
EOF
kubectl config view
kubectl config use-context flux-sandbox
-
name: Deploy
run: |
kubectl rollout restart \
-n schedule-demo \
deployment website