Files
telegram-gateway/.gitea/workflows/dockerimage.yaml
Gabriel Radureau a288564fe7
Some checks failed
CI/CD / test (push) Failing after 2m23s
CI/CD / build-and-push-image (push) Has been skipped
ci: add 'test' job (go vet + go test -race) gating docker build
This was supposed to land in d63f195 but the prior Write didn't apply.
CI now runs unit + integration tests on every push and PR ; the docker
image is only pushed on main, after tests pass.
2026-05-09 15:19:15 +02:00

77 lines
1.7 KiB
YAML

---
name: CI/CD
on:
workflow_dispatch: {}
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'AUTH.md'
- 'DEPLOY.md'
- 'HOWTO_ADD_BOT.md'
- 'chart/**'
- '.gitignore'
- 'Makefile'
- 'bots.example.yaml'
- 'docker-compose.yml'
pull_request:
branches:
- main
paths-ignore:
- 'README.md'
- 'AUTH.md'
- 'DEPLOY.md'
- 'HOWTO_ADD_BOT.md'
- 'chart/**'
- '.gitignore'
- 'docker-compose.yml'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: go vet
run: go vet ./...
- name: go test (race + count=1)
run: go test -race -count=1 -timeout 120s ./...
build-and-push-image:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: gitea.arcodange.lab
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: git checkout
uses: actions/checkout@v4
- name: Build and push image to Gitea Container Registry
run: |-
TAGS="latest ${{ github.ref_name }}"
docker build -t app .
for TAG in $TAGS; do
docker tag app gitea.arcodange.lab/${{ github.repository }}:$TAG
docker push gitea.arcodange.lab/${{ github.repository }}:$TAG
done