Skip to content

Commit 1d2203e

Browse files
authored
Add Github Action and GitPod (#27)
Signed-off-by: rick <[email protected]> Co-authored-by: rick <[email protected]>
1 parent 06bf156 commit 1d2203e

File tree

4 files changed

+102
-1
lines changed

4 files changed

+102
-1
lines changed

.github/workflows/build.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Image Build
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- 'v*.*.*'
9+
pull_request:
10+
branches:
11+
- 'master'
12+
13+
jobs:
14+
Build:
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Docker meta for KubeSphere
19+
id: meta
20+
if: github.repository_owner == 'kubesphere'
21+
uses: docker/metadata-action@v3
22+
with:
23+
images: |
24+
kubespheredev/s2irun
25+
ghcr.io/${{ github.repository_owner }}/s2irun
26+
tags: |
27+
type=schedule
28+
type=ref,event=branch
29+
type=ref,event=pr
30+
type=semver,pattern={{version}}
31+
type=semver,pattern={{major}}.{{minor}}
32+
type=semver,pattern={{major}}
33+
type=sha
34+
- name: Docker meta for Contributors
35+
id: metaContributors
36+
if: github.repository_owner != 'kubesphere'
37+
uses: docker/metadata-action@v3
38+
with:
39+
images: |
40+
ghcr.io/${{ github.repository_owner }}/s2irun
41+
tags: |
42+
type=schedule
43+
type=ref,event=branch
44+
type=ref,event=pr
45+
type=semver,pattern={{version}}
46+
type=semver,pattern={{major}}.{{minor}}
47+
type=semver,pattern={{major}}
48+
type=sha
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v1
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v1
53+
- name: Login to DockerHub
54+
if: github.event_name != 'pull_request'
55+
uses: docker/login-action@v1
56+
with:
57+
username: ${{ secrets.DOCKER_HUB_USER }}
58+
password: ${{ secrets.DOCKER_HUB_SECRETS }}
59+
- name: Login to GHCR
60+
if: github.event_name != 'pull_request'
61+
uses: docker/login-action@v1
62+
with:
63+
registry: ghcr.io
64+
username: ${{ github.repository_owner }}
65+
password: ${{ secrets.GHCR_TOKEN }}
66+
- name: Build and push Docker images
67+
uses: docker/[email protected]
68+
if: github.repository_owner == 'kubesphere'
69+
with:
70+
context: .
71+
file: Dockerfile
72+
tags: ${{ steps.meta.outputs.tags }}
73+
push: ${{ github.event_name != 'pull_request' }}
74+
labels: ${{ steps.meta.outputs.labels }}
75+
platforms: linux/amd64,linux/arm64
76+
- name: Build and push Docker images for Contributors
77+
uses: docker/[email protected]
78+
if: github.repository_owner != 'kubesphere'
79+
with:
80+
context: .
81+
file: Dockerfile
82+
tags: ${{ steps.metaContributors.outputs.tags }}
83+
push: ${{ github.event_name != 'pull_request' }}
84+
labels: ${{ steps.metaContributors.outputs.labels }}
85+
platforms: linux/amd64,linux/arm64

.gitpod.Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM gitpod/workspace-full
2+
3+
# More information: https://www.gitpod.io/docs/config-docker/
4+
RUN sudo rm -rf /usr/bin/hd && \
5+
brew install linuxsuren/linuxsuren/hd && \
6+
hd install cli/cli

.gitpod.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
4+
tasks:
5+
- init: |
6+
git config --global user.name $GIT_AUTHOR_NAME
7+
git config --global user.email $GIT_COMMITTER_EMAIL
8+
echo Yes | gh repo fork
9+
make image

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## S2IRun
2-
2+
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/kubesphere/s2irun)
33
[![License](http://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/KubeSphere/s2irun/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/kubesphere/s2ioperator)](https://goreportcard.com/report/github.com/kubesphere/s2irun) [![S2IRun release](https://img.shields.io/github/release/kubesphere/s2irun.svg?color=release&label=release&logo=release&logoColor=release)](https://github.com/kubesphere/s2irun/releases/tag/v0.0.3)
4+
![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/s2irun)
45

56
Source to image is a command toolkit and workflow for building reproducible container images from source code. S2IRun is the instance that executes the s2i build process, and can be containerized so that it can run in any container environment. S2IRun produces ready-to-run images by injecting source code into a container image and letting the container prepare that source code for execution.
67

0 commit comments

Comments
 (0)