From 514039703d307c001a53421fb96fcc314e221559 Mon Sep 17 00:00:00 2001 From: Andrew Jarvis Date: Fri, 16 Feb 2024 22:59:01 -0500 Subject: [PATCH 1/3] Explicitly define image name --- .github/workflows/build-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index a95cb9f..1315994 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -31,7 +31,7 @@ jobs: uses: buildpacks/github-actions/setup-pack@v5.1.0 - name: Build image - run: pack build ${{ secrets.REGISTRY }}/${{ github.repository }}:latest --builder paketobuildpacks/builder-jammy-base:latest --buildpack gcr.io/paketo-buildpacks/nginx --env BP_WEB_SERVER=nginx + run: pack build ${{ secrets.REGISTRY }}/basic_chess_ai:latest --builder paketobuildpacks/builder-jammy-base:latest --buildpack gcr.io/paketo-buildpacks/nginx --env BP_WEB_SERVER=nginx - name: Push image to registry - run: docker push ${{ secrets.REGISTRY }}/${{ github.repository }}:latest + run: docker push ${{ secrets.REGISTRY }}/basic_chess_ai:latest From 8bb159657b1dc629b2f4a453d16595ca470a4026 Mon Sep 17 00:00:00 2001 From: Andrew Jarvis Date: Fri, 16 Feb 2024 23:05:58 -0500 Subject: [PATCH 2/3] snake case --- .github/workflows/build-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 1315994..3f8f9a4 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -31,7 +31,7 @@ jobs: uses: buildpacks/github-actions/setup-pack@v5.1.0 - name: Build image - run: pack build ${{ secrets.REGISTRY }}/basic_chess_ai:latest --builder paketobuildpacks/builder-jammy-base:latest --buildpack gcr.io/paketo-buildpacks/nginx --env BP_WEB_SERVER=nginx + run: pack build ${{ secrets.REGISTRY }}/basic-chess-ai:latest --builder paketobuildpacks/builder-jammy-base:latest --buildpack gcr.io/paketo-buildpacks/nginx --env BP_WEB_SERVER=nginx - name: Push image to registry - run: docker push ${{ secrets.REGISTRY }}/basic_chess_ai:latest + run: docker push ${{ secrets.REGISTRY }}/basic-chess-ai:latest From 07b9ec32a528619468c2b88329f05a42e8aa0a5f Mon Sep 17 00:00:00 2001 From: Andrew Jarvis Date: Sat, 17 Feb 2024 01:05:05 -0500 Subject: [PATCH 3/3] Use docker buildx --- .github/workflows/build-and-deploy.yml | 11 +++-------- Dockerfile | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 3f8f9a4..18b31a1 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -27,11 +27,6 @@ jobs: - name: Build application run: npm run build - - name: Install pack CLI - uses: buildpacks/github-actions/setup-pack@v5.1.0 - - - name: Build image - run: pack build ${{ secrets.REGISTRY }}/basic-chess-ai:latest --builder paketobuildpacks/builder-jammy-base:latest --buildpack gcr.io/paketo-buildpacks/nginx --env BP_WEB_SERVER=nginx - - - name: Push image to registry - run: docker push ${{ secrets.REGISTRY }}/basic-chess-ai:latest + - name: Build and push image + run: | + docker buildx build --platform linux/arm64 -t ${{ secrets.REGISTRY }}/basic-chess-ai:latest-arm64 --push . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cd70931 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +# Use the official Nginx image from Docker Hub +FROM nginx:latest +COPY public /usr/share/nginx/html