add CI
Some checks failed
/ build (push) Failing after 7s

This commit is contained in:
Chris Cowley 2025-04-02 14:21:25 +02:00
parent 5e8991fabc
commit a64ce638ff
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,9 @@
on:
- push
jobs:
build:
runs-on: ubuntu
steps:
- uses: actions/checkout@v4
- name: build
run: scripts/deploy.sh

14
scripts/deploy.sh Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
REPO="code.lab.cowley.tech/homelab/proxy-test"
VERSION="$(date +%s)"
BRANCH="$(git branch --show-current)"
GITREF="$(git rev-parse --short HEAD)"
if [ "$(git branch --show-current)" == "main" ]
then
docker build -t "${REPO}:${VERSION}-${BRANCH}-${GITREF}" .
docker tag "${REPO}:${VERSION}-${BRANCH}-${GITREF}" "${REPO}:latest"
docker push "${REPO}:${VERSION}-${BRANCH}-${GITREF}"
docker push "${REPO}:latest"
fi