Skip to content

Commit 46eee96

Browse files
developer-guyalexellis
authored andcommitted
github actions integration completed
Signed-off-by: Batuhan Apaydın <[email protected]>
1 parent 38a865d commit 46eee96

File tree

3 files changed

+91
-20
lines changed

3 files changed

+91
-20
lines changed

.github/workflows/build.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
go-version: [1.13.x]
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@master
18+
- name: Install Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: ${{ matrix.go-version }}
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v1
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
27+
- name: Build x86_64 container into library
28+
uses: docker/build-push-action@v2
29+
with:
30+
context: .
31+
file: ./Dockerfile
32+
outputs: "type=docker,push=false"
33+
platforms: linux/amd64
34+
tags: |
35+
ghcr.io/openfaas/cron-connector:${{ github.sha }}
36+
37+
- name: Build multi-arch containers for validation only
38+
uses: docker/build-push-action@v2
39+
with:
40+
context: .
41+
file: ./Dockerfile
42+
outputs: "type=image,push=false"
43+
platforms: linux/amd64,linux/arm/v7,linux/arm64
44+
tags: |
45+
ghcr.io/openfaas/cron-connector:${{ github.sha }}

.github/workflows/publish.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
strategy:
11+
matrix:
12+
go-version: [1.13.x]
13+
os: [ubuntu-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Install Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v1
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
- name: Get TAG
26+
id: get_tag
27+
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v1
30+
- name: Login to Docker Registry
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKER_USERNAME }}
34+
password: ${{ secrets.DOCKER_PASSWORD }}
35+
registry: ghcr.io
36+
- name: Push containers
37+
uses: docker/build-push-action@v2
38+
with:
39+
context: .
40+
file: ./Dockerfile
41+
outputs: "type=registry,push=true"
42+
platforms: linux/amd64,linux/arm/v7,linux/arm64
43+
tags: |
44+
ghcr.io/openfaas/cron-connector:${{ github.sha }}
45+
ghcr.io/openfaas/cron-connector:${{ steps.get_tag.outputs.TAG }}
46+
ghcr.io/openfaas/cron-connector:latest

.travis.yml

-20
This file was deleted.

0 commit comments

Comments
 (0)