[ci] Improve CI scripts
This commit is contained in:
parent
20aca1c8b0
commit
b6b1430cb9
3 changed files with 17 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [published]
|
tags:
|
||||||
|
- '*'
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
@ -8,7 +9,7 @@ jobs:
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
cd /iceshrimp
|
cd /iceshrimp
|
||||||
|
@ -41,11 +42,15 @@ jobs:
|
||||||
registry: iceshrimp.dev
|
registry: iceshrimp.dev
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
- name: Set environment variables
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: https://code.forgejo.org/docker/build-push-action@v5
|
uses: https://code.forgejo.org/docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: iceshrimp.dev/iceshrimp/iceshrimp.net:${{ github.event.release.name }}
|
tags: iceshrimp.dev/${{ env.REPO }}:${{ github.ref_name }}
|
||||||
target: image-aot
|
target: image-aot
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
provenance: false
|
provenance: false
|
||||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
cd /iceshrimp
|
cd /iceshrimp
|
||||||
|
@ -42,11 +42,16 @@ jobs:
|
||||||
registry: iceshrimp.dev
|
registry: iceshrimp.dev
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
- name: Set environment variables
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: https://code.forgejo.org/docker/build-push-action@v5
|
uses: https://code.forgejo.org/docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
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
|
platforms: linux/amd64,linux/arm64
|
||||||
provenance: false
|
provenance: false
|
||||||
cache-from: type=local,src=/buildkit-cache
|
cache-from: type=local,src=/buildkit-cache
|
||||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
||||||
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
image: mcr.microsoft.com/dotnet/sdk:8.0-alpine
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- 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
|
- name: Build backend & frontend
|
||||||
run: |
|
run: |
|
||||||
cd /iceshrimp/Iceshrimp.Backend
|
cd /iceshrimp/Iceshrimp.Backend
|
||||||
|
|
Loading…
Add table
Reference in a new issue