build: optimize github action ci config (#760) #358
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: Build Dev Container | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push events but only for the "master" branch | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Git submodule init | |
uses: snickerbockers/submodules-init@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
cache: 'gradle' | |
java-version: 17 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Clean with gradle | |
run: | | |
./gradlew clean | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Reduce pnpm concurrency | |
run: pnpm config set fetch-retries 5 && pnpm config set fetch-timeout 60000 && pnpm config set max-concurrent-requests 6 | |
- name: Use npm mirror | |
run: | | |
npm config set registry https://registry.npmmirror.com | |
pnpm config set registry https://registry.npmmirror.com | |
- name: Build console with npm | |
run: | | |
./gradlew buildFrontend -x test | |
- name: Build server with gradle | |
run: | | |
./gradlew build -x test | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build image and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
ikarosrun/ikaros:dev |