Build and Publish Docker Image #1
This file contains hidden or 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
| name: Build and Publish Docker Image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Docker image tag" | |
| required: true | |
| default: "latest" | |
| jobs: | |
| build_and_publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Verify Docker setup and pull base Anthropic image | |
| - name: Verify Docker and pull Anthropic image | |
| run: | | |
| docker info | |
| docker version | |
| docker ps | |
| # Pull base image explicitly | |
| docker pull ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./containers/docker | |
| push: true | |
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/kernel-chromium:${{ github.event.inputs.tag }} | |
| cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/kernel-chromium:buildcache | |
| cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/kernel-chromium:buildcache,mode=max |