Skip to content

Commit

Permalink
github actions integration completed
Browse files Browse the repository at this point in the history
Signed-off-by: Batuhan Apaydın <[email protected]>
  • Loading branch information
developer-guy authored and alexellis committed Nov 17, 2020
1 parent 38a865d commit 46eee96
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 20 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

jobs:
build:
strategy:
matrix:
go-version: [1.13.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build x86_64 container into library
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
outputs: "type=docker,push=false"
platforms: linux/amd64
tags: |
ghcr.io/openfaas/cron-connector:${{ github.sha }}
- name: Build multi-arch containers for validation only
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
outputs: "type=image,push=false"
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
ghcr.io/openfaas/cron-connector:${{ github.sha }}
46 changes: 46 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
strategy:
matrix:
go-version: [1.13.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
- name: Push containers
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
outputs: "type=registry,push=true"
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
ghcr.io/openfaas/cron-connector:${{ github.sha }}
ghcr.io/openfaas/cron-connector:${{ steps.get_tag.outputs.TAG }}
ghcr.io/openfaas/cron-connector:latest
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

0 comments on commit 46eee96

Please sign in to comment.