From 51b3745c13c5f9c0fd55a7f93b421925eee5f5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Lu=C3=ADs?= Date: Wed, 12 Jun 2024 17:03:51 -0300 Subject: [PATCH] add ci build container --- .github/workflows/container.yml | 37 +++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..a5ea8c0 --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,37 @@ +# build and publish docker image to ghcr +name: launch3d +on: + push: + tags: + - "v*" + branches: + - main +jobs: + build_and_push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + env: + TAG: ${{ github.ref_name }} + REGISTRY: ghcr.io/${{ github.repository_owner }} + IMAGE_NAME: ${{ github.repository }} + HOSTNAME: localhost + NEXT_PUBLIC_SLURM_GPU_OPTIONS: "1,2,4" + NEXT_PUBLIC_SLURM_MAX_CPUS: "256" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build app image + run: docker build -t $REGISTRY/$IMAGE_NAME:$TAG --build-arg NEXT_PUBLIC_SLURM_GPU_OPTIONS=$NEXT_PUBLIC_SLURM_GPU_OPTIONS --build-arg NEXT_PUBLIC_SLURM_MAX_CPUS=$NEXT_PUBLIC_SLURM_MAX_CPUS . + + - name: Login to ghcr + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push image + run: docker push $REGISTRY/$IMAGE_NAME:$TAG diff --git a/README.md b/README.md index 34818fd..49f6646 100644 --- a/README.md +++ b/README.md @@ -22,5 +22,5 @@ and to provide a simple interface to submit new Annotat3D jobs through the slurm - [x] Improve the design of the instances page - [ ] Better state management of the instances - [x] Dockerfile -- [ ] CI build +- [x] CI build - [ ] Deployment