Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit b3548dc

Browse files
authored
Merge pull request #79 from triggermesh/migrate-ghactions
ci: migrate to gh actions
2 parents d891558 + 5c0c4fe commit b3548dc

File tree

5 files changed

+103
-112
lines changed

5 files changed

+103
-112
lines changed

.circleci/config.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/dependabot.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Dependabot configuration
2+
#
3+
# For more information, please refer to:
4+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
5+
6+
version: 2
7+
8+
updates:
9+
10+
# Maintain dependencies for GitHub Actions
11+
- package-ecosystem: github-actions
12+
directory: /
13+
schedule:
14+
interval: weekly
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
- 'v*'
12+
pull_request:
13+
14+
jobs:
15+
publish-images:
16+
name: Build and publish image
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- runtime: java8
24+
- runtime: node10
25+
- runtime: node4
26+
- runtime: python27
27+
- runtime: python37
28+
- runtime: ruby25
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Set up Docker Buildx
35+
id: buildx
36+
uses: docker/setup-buildx-action@v2
37+
38+
- name: Login to GCR
39+
uses: docker/login-action@v2
40+
with:
41+
registry: gcr.io
42+
username: _json_key
43+
password: ${{ secrets.GCLOUD_SERVICEACCOUNT_KEY }}
44+
if: github.event_name != 'pull_request'
45+
46+
- name: Docker metadata
47+
id: meta
48+
uses: docker/metadata-action@v4
49+
with:
50+
images: gcr.io/triggermesh/knative-lambda-${{ matrix.runtime }}
51+
tags: |
52+
type=semver,pattern={{raw}}
53+
type=sha,prefix=,suffix=,format=long
54+
55+
- name: Build and push image
56+
uses: docker/build-push-action@v4
57+
with:
58+
provenance: false
59+
context: ${{ matrix.runtime }}
60+
file: ${{ matrix.runtime }}/Dockerfile
61+
push: ${{ github.event_name != 'pull_request' }}
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
64+
65+
create-release:
66+
name: Create Release
67+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
68+
runs-on: ubuntu-latest
69+
needs: publish-images
70+
permissions:
71+
contents: write
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v2
76+
with:
77+
fetch-depth: 0
78+
79+
- name: Preparing Release Notes
80+
run: |
81+
./scripts/release-notes.sh ${GITHUB_REF_NAME} > release-notes.md
82+
83+
- name: Creating Release
84+
uses: ncipollo/release-action@v1
85+
with:
86+
bodyFile: "release-notes.md"

Makefile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ BASE_DIR ?= $(CURDIR)
66

77
DOCKER ?= docker
88
IMAGE_REPO ?= gcr.io/triggermesh
9-
IMAGE_TAG ?= latest
10-
IMAGE_SHA ?= $(shell git rev-parse HEAD)
9+
IMAGE_TAG ?= $(shell git rev-parse HEAD)
1110

12-
.PHONY: help images cloudbuild-test cloudbuild
11+
.PHONY: help images
1312

1413
all: images
1514

@@ -19,14 +18,4 @@ help: ## Display this help
1918
IMAGES = $(foreach r,$(RUNTIMES),$(r).image)
2019
images: $(IMAGES) ## Build the Docker images
2120
$(IMAGES): %.image:
22-
docker build -t $(IMAGE_REPO)/knative-lambda-$* $*
23-
24-
CLOUDBUILD_TEST = $(foreach r,$(RUNTIMES),$(r).cloudbuild-test)
25-
cloudbuild-test: $(CLOUDBUILD_TEST) ## Test container image build with Google Cloud Build
26-
$(CLOUDBUILD_TEST): %.cloudbuild-test:
27-
gcloud builds submit $* --config cloudbuild.yaml --substitutions _RUNTIME=knative-lambda-$*,COMMIT_SHA=${IMAGE_SHA},_KANIKO_USE_BUILD_CACHE=false,_KANIKO_IMAGE_TAG=_
28-
29-
CLOUDBUILD = $(foreach r,$(RUNTIMES),$(r).cloudbuild)
30-
cloudbuild: $(CLOUDBUILD) ## Build and publish image to GCR
31-
$(CLOUDBUILD): %.cloudbuild:
32-
gcloud builds submit $* --config cloudbuild.yaml --substitutions _RUNTIME=knative-lambda-$*,COMMIT_SHA=${IMAGE_SHA},_KANIKO_USE_BUILD_CACHE=false,_KANIKO_IMAGE_TAG=${IMAGE_TAG}
21+
docker build -t $(IMAGE_REPO)/knative-lambda-$*:${IMAGE_TAG} $*

cloudbuild.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)