CoolFace
Apppublic

hanabhi/gridworld-env

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
openspiel_base_build.yml107 linesDownload Raw Back to workflows
1name: Build OpenSpiel Base Image2 3on:4  workflow_dispatch:  # Manual trigger only5    inputs:6      force_rebuild:7        description: 'Force rebuild even if base image exists'8        required: false9        default: 'false'10        type: boolean11 12env:13  REGISTRY: ghcr.io14  IMAGE_PREFIX: ${{ github.repository_owner }}/openenv15 16jobs:17  # Job 1: Build base image first18  build-base:19    runs-on: ubuntu-latest20    permissions:21      contents: read22      packages: write23 24    steps:25      - name: Checkout code26        uses: actions/checkout@v427 28      - name: Set up Docker Buildx29        uses: docker/setup-buildx-action@v330 31      - name: Log in to GHCR32        uses: docker/login-action@v333        with:34          registry: ${{ env.REGISTRY }}35          username: ${{ github.actor }}36          password: ${{ secrets.GITHUB_TOKEN }}37 38      - name: Extract metadata for base image39        id: meta40        uses: docker/metadata-action@v541        with:42          images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-base43          tags: |44            type=raw,value=latest,enable={{is_default_branch}}45            type=sha46 47      - name: Build and push base image48        uses: docker/build-push-action@v549        with:50          context: .51          file: src/openenv/core/containers/images/Dockerfile52          push: true53          platforms: linux/amd64,linux/arm6454          tags: ${{ steps.meta.outputs.tags }}55          labels: ${{ steps.meta.outputs.labels }}56          cache-from: type=gha,scope=base57          cache-to: type=gha,mode=max,scope=base58 59  # Job 2: Build OpenSpiel base image (depends on base)60  build-openspiel-base:61    runs-on: 8-core-ubuntu62    needs: build-base  # Wait for base image to be built63    permissions:64      contents: read65      packages: write66 67    steps:68      - name: Checkout code69        uses: actions/checkout@v470 71      - name: Set up Docker Buildx72        uses: docker/setup-buildx-action@v373 74      - name: Log in to GHCR75        uses: docker/login-action@v376        with:77          registry: ${{ env.REGISTRY }}78          username: ${{ github.actor }}79          password: ${{ secrets.GITHUB_TOKEN }}80 81      - name: Extract metadata for OpenSpiel base image82        id: meta-openspiel-base83        uses: docker/metadata-action@v584        with:85          images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-openspiel-base86          tags: |87            type=raw,value=latest,enable={{is_default_branch}}88            type=sha89 90      - name: Build and push OpenSpiel base image91        uses: docker/build-push-action@v592        with:93          context: .94          file: envs/openspiel_env/server/Dockerfile.openspiel-base95          push: true96          platforms: linux/amd64,linux/arm6497          tags: ${{ steps.meta-openspiel-base.outputs.tags }}98          labels: ${{ steps.meta-openspiel-base.outputs.labels }}99          cache-from: type=gha,scope=openspiel-base100          cache-to: type=gha,mode=max,scope=openspiel-base101 102      - name: Build summary103        run: |104          echo "โœ… OpenSpiel base image built and pushed successfully!"105          echo "๐Ÿ“ฆ Image: ${{ steps.meta-openspiel-base.outputs.tags }}"106          echo "๐Ÿš€ Next regular build will use this new base image"107