Skip to content

Commit 1b4b379

Browse files
committed
feat: buildpack based GH build
1 parent 8be618e commit 1b4b379

2 files changed

Lines changed: 28 additions & 48 deletions

File tree

.github/workflows/release.yaml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
name: Release
1+
name: Build and Push Docker Image to GHCR
22

33
on:
44
create:
55
tags:
66
- 'v*.*.*'
77

8+
env:
9+
IMAGE_NAME: exposecontroller
10+
DOCKER_REGISTRY: ghcr.io
11+
DOCKER_REPOSITORY: devopscare
12+
813
jobs:
9-
build:
10-
name: Build and release image
14+
build-and-push:
1115
runs-on: ubuntu-latest
1216
steps:
1317
- name: Checkout
1418
uses: actions/checkout@v2
15-
- name: Version
16-
id: version
17-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
18-
- name: Build and push
19-
uses: docker/build-push-action@v1
2019
with:
21-
username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
repository: olliai/exposecontroller
24-
tags: latest,${{ steps.version.outputs.VERSION }}
20+
fetch-depth: 0 # Mandatory to use the extract version from tag action
2521

26-
bump-version:
27-
name: Bump app version in Helm chart
28-
runs-on: ubuntu-latest
29-
steps:
30-
- name: Checkout
31-
uses: actions/checkout@v2
32-
- name: Version
33-
id: version
34-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
35-
- run: bash ./scripts/bump-app-version.sh publish
22+
- name: Extract version from tag
23+
uses: damienaicheh/extract-version-from-tag-action@v1.1.0
24+
25+
- id: setup-pack
26+
uses: buildpacks/github-actions/setup-pack@v5.0.0
27+
28+
- name: Login to GHCR
29+
uses: docker/login-action@v1
30+
with:
31+
registry: ${{ env.DOCKER_REGISTRY }}
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Build and Push Docker Image
36+
run: |
37+
pack build ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }} \
38+
--builder paketobuildpacks/builder:base \
39+
--publish
3640
env:
37-
CHART_PATH: deploy/helm-chart/exposecontroller
38-
RELEASE_VERSION: ${{ steps.version.outputs.VERSION }}
39-
RELEASE_USER_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }}
40-
RELEASE_USER: ${{ secrets.RELEASE_USER }}
41-
RELEASE_USER_NAME: ${{ secrets.RELEASE_USER_NAME }}
42-
RELEASE_USER_EMAIL: ${{ secrets.RELEASE_USER_EMAIL }}
43-
CHARTS_REPOSITORY: olli-ai/helm-charts
41+
DOCKER_USERNAME: ${{ github.actor }}
42+
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)