37 lines
866 B
YAML
37 lines
866 B
YAML
name: Dev
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "**"
|
|
|
|
jobs:
|
|
release:
|
|
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'v')
|
|
runs-on: build-htz-01
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Build and push Docker image
|
|
run: |
|
|
docker build -t cr.jdbnet.co.uk/public/ipam:dev \
|
|
--build-arg VERSION=dev \
|
|
.
|
|
docker push cr.jdbnet.co.uk/public/ipam:dev
|
|
|
|
deploy:
|
|
name: Deploy to Kubernetes
|
|
needs: release
|
|
runs-on: k3s-internal-htz-01
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Deploy to Kubernetes
|
|
run: |
|
|
sudo kubectl replace -f deployment.yml --grace-period=60 --force |