[ci] Improve CI scripts

This commit is contained in:
Laura Hausmann 2024-04-11 21:18:52 +02:00
parent 20aca1c8b0
commit b6b1430cb9
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
3 changed files with 17 additions and 7 deletions

View file

@ -1,6 +1,7 @@
on:
release:
types: [published]
push:
tags:
- '*'
jobs:
unit-tests:
runs-on: docker
@ -8,7 +9,7 @@ jobs:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
steps:
- name: Clone repository
run: git clone https://iceshrimp.dev/iceshrimp/Iceshrimp.NET.git --branch=${{ github.ref_name }} --depth=1 /iceshrimp
run: git clone ${{ github.event.repository.clone_url }} --branch=${{ github.ref_name }} --depth=1 /iceshrimp
- name: Run unit tests
run: |
cd /iceshrimp
@ -41,11 +42,15 @@ jobs:
registry: iceshrimp.dev
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set environment variables
shell: bash
run: |
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
- name: Build and push
uses: https://code.forgejo.org/docker/build-push-action@v5
with:
push: true
tags: iceshrimp.dev/iceshrimp/iceshrimp.net:${{ github.event.release.name }}
tags: iceshrimp.dev/${{ env.REPO }}:${{ github.ref_name }}
target: image-aot
platforms: linux/amd64,linux/arm64
provenance: false

View file

@ -9,7 +9,7 @@ jobs:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
steps:
- name: Clone repository
run: git clone https://iceshrimp.dev/iceshrimp/Iceshrimp.NET.git --branch=${{ github.ref_name }} --depth=1 /iceshrimp
run: git clone ${{ github.event.repository.clone_url }} --branch=${{ github.ref_name }} --depth=1 /iceshrimp
- name: Run unit tests
run: |
cd /iceshrimp
@ -42,11 +42,16 @@ jobs:
registry: iceshrimp.dev
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set environment variables
shell: bash
run: |
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
- name: Build and push
uses: https://code.forgejo.org/docker/build-push-action@v5
with:
push: true
tags: iceshrimp.dev/iceshrimp/iceshrimp.net:dev
tags: iceshrimp.dev/${{ env.REPO }}:${{ github.ref_name }}
target: image-jit
platforms: linux/amd64,linux/arm64
provenance: false
cache-from: type=local,src=/buildkit-cache

View file

@ -9,7 +9,7 @@ jobs:
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
steps:
- name: Clone repository
run: git clone https://iceshrimp.dev/iceshrimp/Iceshrimp.NET.git --branch=${{ github.ref_name }} --depth=1 /iceshrimp
run: git clone ${{ github.event.repository.clone_url }} --branch=${{ github.ref_name }} --depth=1 /iceshrimp
- name: Build backend & frontend
run: |
cd /iceshrimp/Iceshrimp.Backend