This commit is contained in:
parent
1553f9e7c6
commit
033b5e4fac
3 changed files with 16 additions and 2 deletions
|
@ -6,5 +6,4 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: build
|
||||
run: |
|
||||
echo docker build -t code.lab.cowley.tech/${GITHUB_REPOSITORY}:$(git rev-parse --short HEAD)
|
||||
run: scripts/deploy.sh
|
||||
|
|
1
Makefile
1
Makefile
|
@ -1,4 +1,5 @@
|
|||
GITREF := $(shell git rev-parse --short HEAD)
|
||||
BRANCH := $(shell git branch --show-current)
|
||||
init:
|
||||
podman run --rm -ti -v ${PWD}:/docs docker.io/squidfunk/mkdocs-material new .
|
||||
|
||||
|
|
14
scripts/deploy.sh
Executable file
14
scripts/deploy.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
REPO="code.lab.cowley.tech/homelab/homelab-docs"
|
||||
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
|
Loading…
Add table
Reference in a new issue