Files
ts3gotify/.gitea/workflows/cd.yaml
Timo Behrendt 55989cc86b
Some checks failed
CI / Test (pull_request) Successful in 56s
CD / Test (pull_request) Successful in 22s
CD / Build and push (amd64) (pull_request) Failing after 11s
CD / Build and push (arm64) (pull_request) Failing after 24s
remove qemu
2025-01-07 18:42:21 +01:00

70 lines
1.7 KiB
YAML

name: CD
on:
push:
branches:
- main
pull_request:
env:
DOCKER_REGISTRY: gitea.t000-n.de
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: ".bun-version"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run lint
run: bun run check:code
- name: Run spellcheck
run: bun run check:spell
build_and_push:
name: Build and push
strategy:
matrix:
arch: [amd64, arm64]
needs:
- test
runs-on:
- ubuntu-latest
- linux_${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Get Metadata
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platform: linux/${{ matrix.arch }}
push: false
tags: |
${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest