65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
env:
|
|
REGISTRY: forgejo.sbox.hornwitser.no
|
|
REGISTRY_IMAGE: forgejo.sbox.hornwitser.no/furnavia/schedule-demo
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: forgejo.sbox.hornwitser.no/furnavia/builder:latest
|
|
steps:
|
|
-
|
|
name: Authenticate
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
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: forgejo.sbox.hornwitser.no/furnavia/builder:latest
|
|
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
|