Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate To Github Actions #43

Merged
merged 34 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f56ed99
Migrate to GHA for containerd
galal-hussein May 8, 2024
cecfcbd
Migrate to GHA for containerd
galal-hussein May 8, 2024
fc8e415
Update go
galal-hussein May 8, 2024
91f0469
test newer version of containerd
galal-hussein May 8, 2024
beb9ae1
fix makefile version
galal-hussein May 8, 2024
0d89d98
skip trivy
galal-hussein May 8, 2024
11014e2
skip trivy
galal-hussein May 8, 2024
fca85ee
Merge pull request #1 from galal-hussein/add_gha
galal-hussein May 8, 2024
a030e97
fix windows
galal-hussein May 8, 2024
7fa9433
Fix secrets
galal-hussein May 8, 2024
050029f
use EIO custom runner
galal-hussein May 9, 2024
bb8f3f5
another fix
galal-hussein May 9, 2024
3cf53ec
another fix
galal-hussein May 9, 2024
e39622a
another fix
galal-hussein May 10, 2024
c5dc0bf
remove buildx and install docker
galal-hussein May 10, 2024
751eeb0
fix indentation
galal-hussein May 10, 2024
7165120
fix indentation
galal-hussein May 10, 2024
a7e6ca6
fix indentation
galal-hussein May 10, 2024
69c86b5
fix indentation
galal-hussein May 10, 2024
284f3a5
fix indentation
galal-hussein May 10, 2024
8408ef3
test
galal-hussein May 10, 2024
953ea56
test
galal-hussein May 10, 2024
c37752a
test
galal-hussein May 10, 2024
2cb2e5c
test
galal-hussein May 10, 2024
76719ae
test
galal-hussein May 10, 2024
5e35833
test
galal-hussein May 10, 2024
3a475c5
use kaniko
galal-hussein May 13, 2024
0f60567
use kaniko
galal-hussein May 13, 2024
4083fde
use kaniko
galal-hussein May 13, 2024
cd5a2aa
use kaniko
galal-hussein May 13, 2024
a34a2e5
Use buildx to build and push containerd
galal-hussein May 14, 2024
e9a1d9c
use default github runner
galal-hussein May 14, 2024
6df43c8
Fixes
galal-hussein May 14, 2024
753c63a
remove comment
galal-hussein May 14, 2024
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
177 changes: 0 additions & 177 deletions .drone.yml

This file was deleted.

121 changes: 121 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
on:
push:
branches:
- master
pull_request:

name: Build
jobs:
build-amd64:
permissions:
contents: read # read the repository
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set the TAG value
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"

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

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

- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: rancher/hardened-containerd:${{ env.TAG }}-amd64
file: Dockerfile

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: rancher/hardened-containerd:${{ env.TAG }}-amd64
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
continue-on-error: true

build-arm64:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

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

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

- name: Set the TAG value
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"

- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: rancher/hardened-containerd:${{ env.TAG }}-arm64
file: Dockerfile
outputs: type=docker
platforms: linux/arm64

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: rancher/hardened-containerd:${{ env.TAG }}-arm64
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
continue-on-error: true

build-windows:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

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

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

- name: Set the TAG value
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"
- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: rancher/hardened-containerd:${{ env.TAG }}-amd64-windows
file: Dockerfile.windows
outputs: type=docker
platforms: linux/amd64

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: rancher/hardened-containerd:${{ env.TAG }}-amd64-windows
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
continue-on-error: true

50 changes: 50 additions & 0 deletions .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
release:
types: [published]

jobs:
push-multiarch:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

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

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD

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

- name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

- name: Build container image for Linux
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rancher/hardened-containerd:${{ github.event.release.tag_name }}
file: Dockerfile
platforms: linux/amd64, linux/arm64

- name: Build container image for Windows
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: rancher/hardened-containerd:${{ github.event.release.tag_name }}-amd64-windows
file: Dockerfile.windows
platforms: linux/amd64
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.20.12b2
ARG GO_IMAGE=rancher/hardened-build-base:v1.22.3b1
FROM ${BCI_IMAGE} as bci
FROM ${GO_IMAGE} as builder
ARG ARCH="amd64"
Expand All @@ -19,10 +19,7 @@ RUN set -x && \
mercurial \
subversion \
unzip
RUN if [ "${ARCH}" == "s390x" ]; then \
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-s390_64.zip; \
unzip protoc-3.17.3-linux-s390_64.zip -d /usr; \
elif [ "${ARCH}" == "arm64" ]; then \
RUN if [ "${ARCH}" == "arm64" ]; then \
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-aarch_64.zip; \
unzip protoc-3.17.3-linux-aarch_64.zip -d /usr; \
else \
Expand All @@ -32,7 +29,7 @@ RUN if [ "${ARCH}" == "s390x" ]; then \
# setup containerd build
ARG SRC="github.com/k3s-io/containerd"
ARG PKG="github.com/containerd/containerd"
ARG TAG="v1.6.19-k3s1"
ARG TAG="v1.7.11-k3s1"
RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
RUN git fetch --tags --depth=1 origin ${TAG}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.20.12b2
ARG GO_IMAGE=rancher/hardened-build-base:v1.22.3b1
FROM ${BCI_IMAGE} as bci
FROM ${GO_IMAGE} as builder
ARG ARCH="amd64"
Expand All @@ -25,7 +25,7 @@ RUN curl -LO https://github.com/google/protobuf/releases/download/v3.17.3/protoc
# setup containerd build
ARG SRC="github.com/k3s-io/containerd"
ARG PKG="github.com/containerd/containerd"
ARG TAG="v1.6.14-k3s1"
ARG TAG="v1.7.11-k3s1"
RUN git clone --depth=1 https://${SRC}.git ${GOPATH}/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
RUN git fetch --tags --depth=1 origin ${TAG}
Expand Down
Loading