From 1f3a879944cd8da466f554793b2b9618c946b3ba Mon Sep 17 00:00:00 2001 From: James Andariese Date: Sun, 25 Feb 2024 13:51:06 -0600 Subject: [PATCH] wip --- .github/workflows/build.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..83ed9b8 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,20 @@ +name: Github Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions (on Gitea) 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: metal-docker + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: | + ls -la + docker build --iidfile iid.txt . + stringprefix() { [ ${#1} -le $2 ] && echo $1 && return 0 || stringprefix "${1%?}" $2 ; } + SHORTSHA="$(stringprefix "$GITHUB_SHA" 8)" + for TAG in "$SHORTSHA" "$GITHUB_REF_NAME";do + docker tag "`cat iid.txt`" "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG" + docker push "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG" + done +