notatio/.forgejo/workflows/workflow.yaml
Musselman 8a037a0c41
👷 Fix: Run builds on code modifications only
Now there will not be a new docker image for documentation updates.
2024-06-30 00:07:59 -05:00

53 lines
1.4 KiB
YAML

on:
push:
branches:
- "main"
paths:
- "**/editor_templates/"
- "**/templates/"
- "**/static/"
- "**/*.go"
- "**/*.sh"
- "**/Dockerfile"
jobs:
Clone and Build:
runs-on: website
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
ref: main
repository: Musselman/Notatio
- 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
- name: Building..
run: |
go build
- name: Testing..
run: |
echo "No Testing to do currently.."
- 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 ${{ vars.registry }}
podman logout ${{ vars.registry }}
Cleanup:
runs-on: website
steps:
- name: Cleanup image
run: |
podman rmi -a -f