Files
anyway/.gitea/workflows/backend_build-deploy-stg.yaml
Remy Moll ec3ed054fd
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m15s
Build and deploy the backend to staging / Add a comment to the PR to notify about the deployment (pull_request) Failing after 25s
Run linting on the backend code / Build (pull_request) Successful in 4m7s
Run testing on the backend code / Build (pull_request) Has been cancelled
try using the gitea cli instead
2025-10-14 16:02:27 +02:00

37 lines
1.4 KiB
YAML

on:
pull_request:
branches:
- main
paths:
- backend/**
name: Build and deploy the backend to staging
jobs:
build-and-push:
name: Build and push image
uses: ./.gitea/workflows/workflow_build-image.yaml
with:
# sets a unique tag for each commit in the PR - this gets deployed to a separate application instance using argocd
tag: sha${{ github.sha }}
secrets:
PACKAGE_REGISTRY_ACCESS: ${{ secrets.PACKAGE_REGISTRY_ACCESS }}
notify:
runs-on: ubuntu-latest
name: Add a comment to the PR to notify about the deployment
steps:
- name: Download gitea client
run: |
curl -sSL -o tea https://dl.gitea.com/tea/0.11.0/tea-0.11.0-linux-amd64
chmod +x tea
- name: Post comment
run: |
./tea pr comment ${{ github.event.number }} --body "The backend has been deployed to staging with url https://pr-${{ github.event.number }}.anyway-stg.anydev.info. Check the deployment status in ArgoCD:
[![App Status](https://argocd.kluster.moll.re/api/badge?name=anydev-anyway-backend-stg-pr-${{ github.event.number }}&revision=true&showAppName=true)](https://argocd.kluster.moll.re/applications/anydev-anyway-backend-stg-pr-${{ github.event.number }})"
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_BASE_URL: ${{ secrets.GITEA_BASE_URL }}
GITEA_REPO: ${{ secrets.GITEA_REPO }}