2024-06-30 05:07:59 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
paths:
|
2024-07-02 18:49:18 +00:00
|
|
|
- "editor_templates/"
|
|
|
|
- "templates/"
|
|
|
|
- "static/"
|
2024-07-02 19:29:16 +00:00
|
|
|
- "*go*"
|
2024-07-02 18:49:18 +00:00
|
|
|
- "*.sh"
|
|
|
|
- "Dockerfile"
|
2024-06-28 03:37:50 +00:00
|
|
|
jobs:
|
2024-06-28 03:48:11 +00:00
|
|
|
Clone and Build:
|
2024-07-02 05:41:11 +00:00
|
|
|
runs-on: docker
|
2024-06-28 03:37:50 +00:00
|
|
|
steps:
|
|
|
|
- name: Clone repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: main
|
2024-06-28 03:44:09 +00:00
|
|
|
repository: Musselman/Notatio
|
2024-07-02 19:20:06 +00:00
|
|
|
- name: Set up go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: ">=1.17.0"
|
2024-06-28 03:37:50 +00:00
|
|
|
- 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.."
|
2024-06-28 04:07:10 +00:00
|
|
|
- name: Build image
|
|
|
|
run: |
|
2024-07-02 18:49:18 +00:00
|
|
|
docker build -t notatio .
|
2024-06-28 04:07:10 +00:00
|
|
|
Push-Image:
|
2024-07-02 05:41:11 +00:00
|
|
|
runs-on: docker
|
2024-06-28 04:07:10 +00:00
|
|
|
steps:
|
|
|
|
- name: Push image to registry
|
|
|
|
run: |
|
2024-07-02 18:49:18 +00:00
|
|
|
docker login -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }} docker.io
|
|
|
|
docker push notatio ${{ vars.registry }}
|
|
|
|
docker logout ${{ vars.registry }}
|