:-'Generic Commit'
Some checks failed
Gitea Actions Demo / Build (push) Failing after 19s

This commit is contained in:
Your Name 2025-05-29 18:49:59 +12:00
parent c15e91cde8
commit 9453d61479
4 changed files with 52 additions and 4 deletions

View File

@ -0,0 +1,18 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build the project
run: |
./build.sh
- name: Publish
run: |
./publish.sh

14
build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail
# iterate through the docker files in format Dockerfile.IMAGE_NAME
for dockerfile in Dockerfile.*
do
# get the image name from the dockerfile
image_name="${dockerfile//Dockerfile./}"
# build the gitea.jde.nz/public/bb64:debian-curl docker image
docker build -t "$image_name:latest" -f "$dockerfile" .
done

View File

@ -1,8 +1,24 @@
#!/bin/bash #!/bin/bash
# build the gitea.jde.nz/public/bb64:debian-curl docker image set -euo pipefail
docker build -t gitea.jde.nz/public/debian-curl:latest -f Dockerfile .
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# get date/time in local timezone, format YYYY.MMDD.HHMMSS
DATETIME=$(date +%Y.%m%d.%H%M%S)
"${SCRIPTDIR}/build.sh"
# iterate through the docker files in format Dockerfile.IMAGE_NAME
for dockerfile in Dockerfile.*
do
# get the image name from the dockerfile
image_name="${dockerfile//Dockerfile./}"
# tag the image with the latest tag
docker tag "$image_name:latest" "gitea.jde.nz/public/$image_name:latest"
docker tag "$image_name:latest" "gitea.jde.nz/public/$image_name:$DATETIME"
# push the image to the local docker registry
docker push -a "gitea.jde.nz/public/$image_name"
done
# push the gitea.jde.nz/public/bb64:debian-curl docker image to the gitea.jde.nz registry
docker push gitea.jde.nz/public/debian-curl:latest