From a0abdcbf8f827e0574db241eb2164729e22c28ee Mon Sep 17 00:00:00 2001 From: Pagwin Date: Fri, 15 Sep 2023 16:20:14 -0400 Subject: [PATCH] minor correction to the docker build and 2 docker container build steps --- .github/workflows/website-publish.yml | 14 ++++++++++++-- Dockerfile | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website-publish.yml b/.github/workflows/website-publish.yml index 3c8516f..f0eef6f 100644 --- a/.github/workflows/website-publish.yml +++ b/.github/workflows/website-publish.yml @@ -39,14 +39,24 @@ jobs: # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - - name: Build and push Docker image + - name: Build and push Docker image(no comments) uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: context: . push: true # https://github.com/docker/metadata-action#basic - tags: user/website_frontend:latest , user/website_frontend:${{ steps.meta.outputs.sha }} + tags: user/website_frontend:latest labels: ${{ steps.meta.outputs.labels }} + - name: Build and push Docker image(yes comments) + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + # https://github.com/docker/metadata-action#basic + tags: user/website_frontend:latest + labels: ${{ steps.meta.outputs.labels }} + build-args: + - COMMENTS_BACKEND=comments_backend #jobs: # build: # runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index 20d8ec9..949e2ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ADD . /root/ WORKDIR /root # pass in the uri or ip of the comments api so nginx can forward to it ARG COMMENTS_BACKEND -ENV COMMENTS_BACKEND=${WITH_BACKEND} +ENV COMMENTS_BACKEND=${COMMENTS_BACKEND} RUN ["/usr/bin/hugo", "--minify"] FROM python:3.11-alpine as fiddling