Compare commits

..

No commits in common. "c56dc288b6e93b3ff0f8af17606777bd918fd9a6" and "c300623450d1044ef54080d69f0af32c49fd58a5" have entirely different histories.

2 changed files with 24 additions and 46 deletions

View file

@ -1,51 +1,37 @@
name: ci
name: Create and publish a Docker image
on: push
jobs:
build:
runs-on: ubuntu-22.04
docker:
runs-on: docker
steps:
-
name: Repository meta
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Repository meta
id: repository
run: |
registry=${{ github.server_url }}
registry=${registry##http*://}
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
echo "registry=${registry}"
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
echo "repository=${repository}"
-
name: Docker meta
- name: Docker meta
uses: docker/metadata-action@v5
id: docker
with:
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
-
name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ steps.repository.outputs.registry }}
username: ${{ secrets.PACKAGES_USER }}
password: ${{ secrets.PACKAGES_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: '--allow-insecure-entitlement network.host'
driver-opts: network=host
-
name: Build and push
uses: docker/build-push-action@v6
- name: Build and push
uses: https://codeberg.org/umglurf/kaniko-action@main
with:
credentials: |
${{ steps.repository.outputs.registry }}=${{ github.repository }}:${{ secrets.PACKAGES_TOKEN }}
destinations: |
${{ steps.docker.outputs.tags }}
push: true
allow: network.host
network: host
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker.outputs.tags }}

View file

@ -14,9 +14,9 @@ RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {
# Stage 2 - Install dependencies and build packages
FROM node:20.18.1 AS build
# Required for arm64
# Required for macOS
RUN apt update -y
RUN apt install -y python3 make gcc build-essential bash
RUN apt install -y python3 make gcc build-essential
USER node
WORKDIR /app
@ -24,7 +24,7 @@ WORKDIR /app
COPY --from=packages --chown=node:node /app .
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
yarn install --frozen-lockfile --network-timeout 600000
yarn install --network-timeout 600000
COPY --chown=node:node . .
@ -51,15 +51,7 @@ RUN yarn config set python /usr/bin/python3
# Add kubectl for the kube apply plugin.
# Add mkdocs for the TechDocs plugin.
RUN if test "$(uname -m)" = "x86_64"; \
then \
curl -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.29.9/bin/linux/amd64/kubectl; \
fi
RUN if test "$(uname -m)" != "x86_64"; \
then \
curl -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.29.9/bin/linux/arm64/kubectl; \
fi
RUN chmod +x /usr/local/bin/kubectl
RUN curl -L -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.29.9/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
@ -80,7 +72,7 @@ WORKDIR /app
COPY --from=build --chown=node:node /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton/ ./
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
yarn install --frozen-lockfile --production --network-timeout 600000
yarn install --production --network-timeout 600000
# Copy the built packages from the build stage
COPY --from=build --chown=node:node /app/packages/backend/dist/bundle/ ./