Skip to content

Commit d2baa52

Browse files
committed
WIP CI and publish job
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent a1172a7 commit d2baa52

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@master
16+
with:
17+
fetch-depth: 1
18+
- name: Get faas-cli
19+
uses: alexellis/arkade-get@master
20+
with:
21+
faas-cli: latest
22+
- name: Pull custom templates from stack.yml
23+
run: faas-cli template pull stack
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
- name: Get Repo Owner
29+
id: get_repo_owner
30+
run: >
31+
echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} |
32+
tr '[:upper:]' '[:lower:]')
33+
- name: Publish functions
34+
run: >
35+
OWNER="${{ steps.get_repo_owner.outputs.repo_owner }}"
36+
TAG="latest"
37+
faas-cli publish
38+
--extra-tag ${{ github.sha }}
39+
--build-arg GO111MODULE=on
40+
--platforms linux/amd64,linux/arm64
41+
--filter release-promoter

.github/workflows/publish.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
actions: read
10+
checks: write
11+
contents: read
12+
packages: write
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@master
19+
with:
20+
fetch-depth: 1
21+
- name: Get faas-cli
22+
uses: alexellis/arkade-get@master
23+
with:
24+
faas-cli: latest
25+
- name: Pull custom templates from stack.yml
26+
run: faas-cli template pull stack
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
- name: Get TAG
32+
id: get_tag
33+
run: echo ::set-output name=TAG::latest-dev
34+
- name: Get Repo Owner
35+
id: get_repo_owner
36+
run: >
37+
echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} |
38+
tr '[:upper:]' '[:lower:]')
39+
- name: Docker Login
40+
run: >
41+
echo ${{secrets.GITHUB_TOKEN}} |
42+
docker login ghcr.io --username
43+
${{ steps.get_repo_owner.outputs.repo_owner }}
44+
--password-stdin
45+
- name: Publish functions
46+
run: >
47+
OWNER="${{ steps.get_repo_owner.outputs.repo_owner }}"
48+
TAG="latest"
49+
faas-cli publish
50+
--extra-tag ${{ github.sha }}
51+
--extra-tag ${{ steps.get_tag.outputs.TAG }}
52+
--build-arg GO111MODULE=on
53+
--platforms linux/amd64,linux/arm64
54+
--filter release-promoter

0 commit comments

Comments
 (0)