Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 12 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Docker

on:
# schedule:
# - cron: '44 6 * * *'
push:
branches: [ master ]
# Publish semver tags as releases.
tags: [ '*.*.*' ]
pull_request:
branches: [ master ]
Expand All @@ -14,45 +11,39 @@ env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
Build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log into registry
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
Expand All @@ -62,11 +53,10 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

Documentation:
runs-on: 'ubuntu-latest'
needs: Build
if: github.ref == 'refs/heads/master'
env:
DOC_GITHUB_TOKEN: '${{ secrets.DOC_TOKEN }}'
steps:
- uses: actions/checkout@v2
- run: curl https://opensource.byjg.com/add-doc.sh | bash /dev/stdin devops k8s-ci
needs: Build
uses: byjg/byjg.github.io/.github/workflows/add-doc.yaml@master
with:
folder: devops
project: ${{ github.event.repository.name }}
secrets: inherit
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM docker.io/ubuntu:22.04
FROM docker.io/ubuntu:24.04

ENV HELM_VERSION=3.11.3
ENV KUSTOMIZE_VERSION=5.0.2
ENV DOCTL_VERSION=1.94.0
ENV GCLOUD_VERSION=429.0.0
ENV EKSCTL_VERSION=v0.140.0
ENV HELM_VERSION=3.16.1
ENV KUSTOMIZE_VERSION=5.4.3
ENV DOCTL_VERSION=1.114.0
ENV EKSCTL_VERSION=v0.190.0

ARG DEBIAN_FRONTEND=noninteractive
#ARG BUILDPLATFORM
Expand All @@ -20,8 +19,10 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; \
wget curl gnupg gnupg2 gnupg1 \
unzip curl wget git python3 libffi-dev build-essential \
python3-cffi python3-pip groff ansible bash \
docker iptables runc podman buildah \
iptables runc podman buildah \
jq \
&& curl -fsSL https://get.docker.com -o get-docker.sh \
&& sh get-docker.sh \
&& wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq \
&& echo 'cgroup_manager="cgroupfs"' >> /etc/containers/libpod.conf \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -35,7 +36,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; \
&& mv /tmp/kustomize /usr/bin/kustomize \
&& curl -Ls https://github.com/digitalocean/doctl/releases/download/v${DOCTL_VERSION}/doctl-${DOCTL_VERSION}-linux-${PLATFORM}.tar.gz | tar xz -C /tmp \
&& mv /tmp/doctl /usr/bin/doctl \
&& curl -Ls https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-${PLATFORM_GOOGLE}.tar.gz | tar xz -C /opt \
&& curl -Ls https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-${PLATFORM_GOOGLE}.tar.gz | tar xz -C /opt \
&& /opt/google-cloud-sdk/install.sh --command-completion true --path-update true -q \
&& curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/${EKSCTL_VERSION}/eksctl_$(uname -s)_${PLATFORM}.tar.gz" | tar xz -C /tmp \
&& mv /tmp/eksctl /usr/local/bin \
Expand Down