diff --git a/.github/workflows/develop-build.yaml b/.github/workflows/develop-build.yaml new file mode 100644 index 000000000..464c5a08f --- /dev/null +++ b/.github/workflows/develop-build.yaml @@ -0,0 +1,17 @@ +name: Docker develop build + +on: + push: + branches: + - 'develop' + +jobs: + build-bvm-website-develop: + uses: TrustlessComputer/tc-github-action-templates/.github/workflows/docker-build-and-push.yaml@main + with: + DOCKER_IMAGE_NAME: bvm-website + DOCKERFILE_NAME: Dockerfile + CONCURRENCY_GROUP: docker_build_develop + RUNNER_TAG: ubuntu-latest + secrets: + GCLOUD_DEV_SERVICE_ACCOUNT_JSON: ${{ secrets.GCLOUD_DEV_SERVICE_ACCOUNT_JSON }} diff --git a/.github/workflows/docker-cache.yaml b/.github/workflows/docker-cache.yaml new file mode 100644 index 000000000..99abe654f --- /dev/null +++ b/.github/workflows/docker-cache.yaml @@ -0,0 +1,14 @@ +name: Docker cache build + +on: + push: + branches: + - main + +jobs: + docker-cache: + uses: TrustlessComputer/tc-github-action-templates/.github/workflows/docker-build-cache.yaml@main + with: + DOCKER_IMAGE_NAME: bvm-website + DOCKERFILE_NAME: cache.Dockerfile + diff --git a/.github/workflows/production-build.yaml b/.github/workflows/production-build.yaml new file mode 100644 index 000000000..016479e1f --- /dev/null +++ b/.github/workflows/production-build.yaml @@ -0,0 +1,17 @@ +name: Docker production build + +on: + push: + tags: + - 'v[0-9].[0-9]+.[0-9]+' + +jobs: + build-bvm-website-production: + uses: TrustlessComputer/tc-github-action-templates/.github/workflows/docker-build-and-push.yaml@main + with: + DOCKER_IMAGE_NAME: bvm-website + DOCKERFILE_NAME: Dockerfile + CONCURRENCY_GROUP: docker_build_production + RUNNER_TAG: ubuntu-latest + secrets: + GCLOUD_DEV_SERVICE_ACCOUNT_JSON: ${{ secrets.GCLOUD_DEV_SERVICE_ACCOUNT_JSON }} diff --git a/.github/workflows/staging-build.yaml b/.github/workflows/staging-build.yaml new file mode 100644 index 000000000..42dd40ec4 --- /dev/null +++ b/.github/workflows/staging-build.yaml @@ -0,0 +1,17 @@ +name: Docker Alpha staging build + +on: + push: + branches: + - 'staging' + +jobs: + build-bvm-website-staging: + uses: TrustlessComputer/tc-github-action-templates/.github/workflows/docker-build-and-push.yaml@main + with: + DOCKER_IMAGE_NAME: bvm-website + DOCKERFILE_NAME: Dockerfile + CONCURRENCY_GROUP: docker_build_staging_alpha + RUNNER_TAG: ubuntu-latest + secrets: + GCLOUD_DEV_SERVICE_ACCOUNT_JSON: ${{ secrets.GCLOUD_DEV_SERVICE_ACCOUNT_JSON }} diff --git a/Dockerfile b/Dockerfile index 7b16f1966..ad32c841d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,8 @@ -FROM node:18-alpine AS base +FROM node:18-bullseye AS base # 1. Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat openssh git -RUN git config --global url."https://github".insteadOf ssh://git@github WORKDIR /app diff --git a/cache.Dockerfile b/cache.Dockerfile index f4abaeb7c..6fa1bc891 100644 --- a/cache.Dockerfile +++ b/cache.Dockerfile @@ -1,14 +1,11 @@ -FROM node:18-alpine AS base +FROM node:18-bullseye AS base # 1. Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat openssh git -RUN git config --global url."https://github".insteadOf ssh://git@github WORKDIR /app # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ RUN yarn install -