parent
5e8991fabc
commit
a64ce638ff
2 changed files with 23 additions and 0 deletions
9
.forgejo/workflows/build.yml
Normal file
9
.forgejo/workflows/build.yml
Normal 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
14
scripts/deploy.sh
Normal 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
|
Loading…
Add table
Reference in a new issue