2024-06-28 03:37:50 +00:00
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
Clone:
|
|
|
|
runs-on: website
|
|
|
|
steps:
|
|
|
|
- name: Clone repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: main
|
2024-06-28 03:44:09 +00:00
|
|
|
repository: Musselman/Notatio
|
2024-06-28 03:37:50 +00:00
|
|
|
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
|