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:develop 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} < ~/.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 }}:latest ${{ github.workspace }} podman push ${{ env.REGISTRY_IMAGE }}:latest outputs: DEPLOY_IMAGE: ${{ steps.info.outputs.DEPLOY_IMAGE }} DEPLOY_BRANCH: ${{ steps.info.outputs.DEPLOY_BRANCH }} deploy: runs-on: debian needs: build container: image: forge.hornwitser.no/hornwitser/builder:develop 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