Skip to content

Commit

Permalink
chore(cicd): add more tags & multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
michalziobro committed Jan 10, 2023
1 parent c1797f4 commit 67a2137
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores

release:
name: Release helm chart
name: Create Github Release
runs-on: ubuntu-latest
needs: [push-tag]

Expand All @@ -61,6 +61,7 @@ jobs:
body: ${{ needs.push-tag.outputs.changelog }}

build-and-push-image:
name: Build and push Docker image
runs-on: ubuntu-latest
needs: [push-tag]
permissions:
Expand All @@ -71,6 +72,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
Expand All @@ -85,10 +92,11 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.push-tag.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
file: ./docker/Dockerfile
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sample-go-app
Sample application written in Go
Sample application written in Go. Here should be a description of what the purpose of the application is.

## Run locally
Instructions how to run app locally.
Expand All @@ -25,9 +25,29 @@ Run:
gofmt -s -w .
```


## How to use

Hello world:
```
% curl localhost:8000
Hello, world!
```


Get latest block of Volta network:
```
% curl localhost:8000/block
21118165
```

## Docker
Instructions how to run app with Docker.

```
docker run --rm -p 8000:8000 ghcr.io/energywebfoundation/sample-go-app:master
```


Build docker image:
```
Expand Down
4 changes: 2 additions & 2 deletions helm/sample-go-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
replicaCount: 1

image:
repository: nginx
repository: ghcr.io/energywebfoundation/sample-go-app
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
tag: "latest"

imagePullSecrets: []
nameOverride: ""
Expand Down

0 comments on commit 67a2137

Please sign in to comment.