Skip to content

Commit

Permalink
Build go app (#3)
Browse files Browse the repository at this point in the history
* Build go app

* Added go version

* Added go version
  • Loading branch information
rembik authored Feb 1, 2024
1 parent 0734e24 commit c6d5d8f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
50 changes: 27 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
- 'main'
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Check out repository
uses: actions/checkout@v2
-
name: Set build variables
- name: Check out repository
uses: actions/checkout@v4

- name: Set build variables
id: env
run: |
REGISTRY=ghcr.io/
Expand All @@ -44,39 +44,43 @@ jobs:
# elif [ "${{ github.event_name }}" = "push" ]; then
# TAGS="$TAGS,${REGISTRY}${IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "name=tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Set up GO
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build GO app
run: |
GOOS=linux CGO_ENABLED=0 go build -o app
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[worker.oci]
max-parallelism = 4
-
name: Check out Docker Buildx cache
uses: actions/cache@v2
- name: Check out Docker Buildx cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to GitHub Container Registry
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push image
- name: Build and push image
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
APP=ca-injector
IMAGE=ca-injector
TAG?=latest
DOCKER_ROOT?=rembik
DOCKER_ROOT?=zeiss
NAMESPACE=cert-manager

FQTAG=$(DOCKER_ROOT)/$(IMAGE):$(TAG)
Expand Down

0 comments on commit c6d5d8f

Please sign in to comment.