From a7de863973bd245fa8f893d25556f51ed9deafd4 Mon Sep 17 00:00:00 2001 From: Musselman Date: Thu, 27 Jun 2024 22:37:50 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Feature:=20Forgejo=20Ac?= =?UTF-8?q?tions=20First=20Draft?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I am unsure if this will fully work but it is progress --- .forgejo/workflows/workflow.yaml | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .forgejo/workflows/workflow.yaml diff --git a/.forgejo/workflows/workflow.yaml b/.forgejo/workflows/workflow.yaml new file mode 100644 index 0000000..6f3b200 --- /dev/null +++ b/.forgejo/workflows/workflow.yaml @@ -0,0 +1,57 @@ +on: [push] +jobs: + Clone: + runs-on: website + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + ref: main + repository: https://git.musselman.dev/Musselman/Notatio.git + Retrive-Tag: + runs-on: website + steps: + - name: Get latest tag + run: | + tagOutput=$(git describe --abbrev=0 --tags || true) + if [ -z "$tagOutput" ] || [ "$tagOutput" == "fatal: No names found, cannot describe anything." ]; then + TAG='latest' + echo "No tags found, using default tag: $TAG" + else + TAG=$tagOutput + echo "Latest tag found: $TAG" + fi + Build: + runs-on: website + steps: + - name: Building.. + run: | + go build + Test: + runs-on: website + steps: + - name: Testing.. + run: | + echo "No Testing to do currently.." + + Create-Image: + runs-on: website + steps: + - name: Build image + run: | + podman build -t notatio . + Push-Image: + runs-on: website + steps: + - name: Push image to registry + run: | + podman login -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }} docker.io + podman push notatio ${{ env.registry }}:${{ env.TAG }} + podman logout ${{ env.registry }} + +Cleanup: + runs-on: website + steps: + - name: Cleanup image + run: | + podman rmi -a -f