Iceshrimp.NET/.forgejo/workflows/commit.yaml
2024-07-24 05:58:38 +02:00

27 lines
1 KiB
YAML

on:
push:
branches:
- 'dev'
jobs:
test-build-and-push:
runs-on: docker
container:
image: iceshrimp.dev/iceshrimp/ci-env:dotnet
options: |
--volume /opt/iceshrimp-cache/nuget:/root/.nuget
--volume /root/.docker:/root/.docker
steps:
- name: Clone repository
run: git clone ${{ github.event.repository.clone_url }} --branch=${{ github.ref_name }} --depth=1 .
- name: Print environment info
run: dotnet --info
- name: Run unit tests
run: make test VERBOSE=true
- name: Build docker image
shell: bash
run: |
make cleanall >/dev/null
docker login iceshrimp.dev -u ${{ github.actor }} -p ${{ secrets.REGISTRY_TOKEN }}
docker buildx create --name iceshrimp-ci 2>&1 &>/dev/null || true
docker buildx build -t iceshrimp.dev/${GITHUB_REPOSITORY@L}:$GITHUB_REF_NAME --provenance=false --platform=linux/amd64,linux/arm64 --push --builder iceshrimp-ci .
docker buildx prune --keep-storage 20G --builder iceshrimp-ci