mirror of
https://github.com/openfaas/faas.git
synced 2025-06-27 01:03:26 +00:00
Convert Gateway to Github Actions
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit is contained in:
127
.github/workflows/build.yml
vendored
Normal file
127
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
# Auth
|
||||
# Watchdog containers
|
||||
# Watchdog bins + shas
|
||||
|
||||
jobs:
|
||||
|
||||
# Run the CI tests
|
||||
build-test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Run CI
|
||||
run: make build test-ci
|
||||
|
||||
build-gateway:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- 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::latest-dev
|
||||
- name: Get Repo Owner
|
||||
id: get_repo_owner
|
||||
run: echo ::set-output name=repo_owner::$(echo ${{ github.event.repository.owner.login }} | tr '[:upper:]' '[:lower:]')
|
||||
- name: Build Gateway
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./gateway/Dockerfile
|
||||
outputs: "type=image,push=false"
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: |
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:latest
|
||||
|
||||
build-watchdog:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- 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::latest-dev
|
||||
- name: Get Repo Owner
|
||||
id: get_repo_owner
|
||||
run: echo ::set-output name=repo_owner::$(echo ${{ github.event.repository.owner.login }} | tr '[:upper:]' '[:lower:]')
|
||||
- name: Build Watchdog
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./gateway/Dockerfile
|
||||
outputs: "type=image,push=false"
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: |
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ steps.get_tag.outputs.TAG }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:${{ github.sha }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/gateway:latest
|
||||
build-auth-containers:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
svc: [
|
||||
basic-auth
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- 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::latest-dev
|
||||
- name: Get Repo Owner
|
||||
id: get_repo_owner
|
||||
run: echo ::set-output name=repo_owner::$(echo ${{ github.event.repository.owner.login }} | tr '[:upper:]' '[:lower:]')
|
||||
- name: Build ${{ matrix.svc }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: ./auth/${{ matrix.svc }}
|
||||
file: ./auth/${{ matrix.svc }}/Dockerfile
|
||||
outputs: "type=image,push=false"
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: |
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ steps.get_tag.outputs.TAG }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:${{ github.sha }}
|
||||
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/${{ matrix.svc }}:latest
|
Reference in New Issue
Block a user