Skip to content

refactor(rootfs): Optimize Dockerfile by reducing image size (#10) #72

refactor(rootfs): Optimize Dockerfile by reducing image size (#10)

refactor(rootfs): Optimize Dockerfile by reducing image size (#10) #72

Workflow file for this run

name: Dev-CI
on:
push:
branches: [ "dev" ]
pull_request_target:
branches: [ "dev" ]
env:
PYTHON_VERSION: 3.10.14
JAVA_VERSION: 8.0.412+8
RUST_VERSION: 1.60.0
CC_VERSION: 11
jobs:
test-app-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Golang version
run: echo -n "GO_VERSION=$(grep go go.mod | head -n1 | cut -d ' ' -f 2 | tr -d '\n')" >> $GITHUB_ENV
- name: Setup Golang
uses: actions/[email protected]
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Java
uses: actions/[email protected]
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Setup CC
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ env.CC_VERSION }} g++-${{ env.CC_VERSION }}
- name: Setup Rustc
run: sudo apt-get install -y rustc # TODO it need to fix to specific version rustc, but compile one wasting too much time X(.
- name: Test code
run: |
sudo go mod tidy
sudo make unit-test
build-release-app-image-job:
needs: test-app-job
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- 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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Make Rootfs Before Build Image
run: ROOTFS_IMAGE_TAG=latest make rootfs
- name: Build and push
env:
image_owner: msqt
image_name: sb-judger
image_tag: dev
uses: docker/build-push-action@v5
with:
context: .
file: build/Dockerfile
tags: ${{ env.image_owner }}/${{ env.image_name }}:${{ env.image_tag }}
platforms: linux/amd64,linux/arm64
push: true