Files
tasknote/.github/workflows/ci-main-frontend.yml
T
rmcampos 68f8000ed8
Main CI-Frontend / Build & Push (push) Successful in 29s
Main CI-Backend / Build & Push (push) Successful in 4m5s
fix: main workflow files
2026-06-15 18:54:19 -03:00

79 lines
2.4 KiB
YAML

name: Main CI-Frontend
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'client/**/*.html'
- 'client/**/*.png'
- 'client/**/*.json'
- 'client/**/*.txt'
- 'client/**/*.ts'
- 'client/**/*.tsx'
- 'client/**/*.js'
- 'client/Dockerfile'
- 'client/Caddyfile'
- '.github/workflows/ci-main-frontend.yml'
jobs:
build-and-push:
name: Build & Push
runs-on: easynode-debian
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate version tag
id: version
run: |
DATE=$(date +'%Y.%m.%d')
TAG="app-v${DATE}.${{ github.run_number }}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "Generated tag: ${TAG}"
- name: Set up Docker Buildx
run: docker buildx inspect --bootstrap
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Find PR number
id: find_pr
run: |
PR_NUMBER=$(curl -s \
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
"https://lightroasted.vps-kinghost.net/api/v1/repos/${{ github.repository }}/commits/${{ github.sha }}/pull" \
| jq -r 'if type == "object" and .number != null then .number | tostring else empty end')
if [ -z "$PR_NUMBER" ]; then
echo "No merged PR found for this commit. Falling back to 'candidate' tag."
PR_NUMBER="candidate"
else
PR_NUMBER="pr-${PR_NUMBER}"
fi
echo "tag=${PR_NUMBER}" >> $GITHUB_OUTPUT
- name: Promote Docker image
run: |
docker buildx imagetools create \
--tag rmcampos/tasknote-app:latest \
--tag rmcampos/tasknote-app:${{ steps.version.outputs.tag }} \
rmcampos/tasknote-app:${{ steps.find_pr.outputs.tag }}
- name: Create and push Git tag
run: |
git config user.name "gitea-actions[bot]"
git config user.email "gitea-actions[bot]@noreply.lightroasted.vps-kinghost.net"
git tag -a ${{ steps.version.outputs.tag }} -m "Release ${{ steps.version.outputs.tag }}"
git push origin ${{ steps.version.outputs.tag }}