Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: build

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

jobs:
build:
strategy:
matrix:
go-version: [1.15.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 Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')

- 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/${{ steps.get_repo_owner.outputs.repo_owner }}/nats-queue-worker:${{ 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/${{ steps.get_repo_owner.outputs.repo_owner }}/nats-queue-worker:${{ github.sha }}
50 changes: 50 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest

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: Login to Docker Registry
uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io

- name: Get TAG
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Get Repo Owner
id: get_repo_owner
run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
- name: Get Commit Message
id: get_commit_message
run: echo ::set-output name=commit_message::$(git log -1 --pretty=%B 2>&1 | head -n 1)

- name: Publish ${{ matrix.svc }}
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
outputs: "type=registry,push=true"
platforms: linux/amd64,linux/arm/v7,linux/arm64
build-args: |
VERSION=${{ steps.get_tag.outputs.TAG }}
GIT_COMMIT=${{ github.sha }}
tags: |
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/nats-queue-worker:${{ steps.get_tag.outputs.TAG }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/nats-queue-worker:${{ github.sha }}
ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/nats-queue-worker:latest
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TAG?=latest
export DOCKER_CLI_EXPERIMENTAL=enabled

.PHONY: build
build: $(addprefix build-,$(ARCHS)) ## Build Docker images for all architectures
build: $(addprefix build-,$(ARCHS)) ## Build Docker images for all architectures

.PHONY: build-%
build-%:
Expand All @@ -22,7 +22,7 @@ push: $(addprefix push-,$(ARCHS)) ## Push Docker images for all architectures

.PHONY: push-%
push-%:
docker push $(DOCKER_REPOSITORY):$(TAG)-$*
docker push $(DOCKER_REPOSITORY):$(TAG)-$*

.PHONY: manifest
manifest: ## Create and push Docker manifest to combine all architectures in multi-arch Docker image
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ Screenshots from keynote / video - find out more over at https://www.openfaas.co
| `faas_nats_cluster_name` | The name of the target NATS Streaming cluster | `faas-cluster` |
| `faas_reconnect_delay` | Delay between retrying to connect to NATS | `2s` |
| `faas_print_body` | Print the body of the function invocation | `false` |