-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
4,986 additions
and
4,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: 'Build Image' | ||
description: 'Builds and pushes images' | ||
inputs: | ||
image-tag-prefix: # prefix the tag with this | ||
description: 'IMAGE_TAG_PREFIX' | ||
required: false | ||
default: '' | ||
backend-dockerfile: # dockerfile for backend build | ||
description: 'DOCKERFILE_BACKEND' | ||
required: false | ||
default: Dockerfile.backend-container | ||
frontend-dockerfile: # dockerfile for frontend build | ||
description: 'DOCKERFILE_FRONTEND' | ||
required: false | ||
default: frontend/Dockerfile.frontend-container | ||
tag-version: # set to true if tagging official version | ||
description: 'VERSION' | ||
required: false | ||
default: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set image tag prefix | ||
shell: bash | ||
run: echo "IMAGE_TAG_PREFIX=${{ inputs.image-tag-prefix }}" >> $GITHUB_ENV | ||
- name: Set backend dockerfile | ||
shell: bash | ||
run: echo "DOCKERFILE_BACKEND=${{ inputs.backend-dockerfile }}" >> $GITHUB_ENV | ||
- name: Set frontend dockerfile | ||
shell: bash | ||
run: echo "DOCKERFILE_FRONTEND=${{ inputs.frontend-dockerfile }}" >> $GITHUB_ENV | ||
|
||
- name: Install Golang | ||
uses: actions/[email protected] | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: true | ||
|
||
- name: Download modules | ||
shell: bash | ||
run: go mod download | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: '18' | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
#- name: Set up QEMU | ||
# uses: docker/setup-qemu-action@v3 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Download modules | ||
shell: bash | ||
run: go mod download | ||
|
||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.57.2 | ||
args: --timeout 7m | ||
|
||
# set repo and GITHUB SHA | ||
- name: Set github commit id | ||
shell: bash | ||
run: echo "GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV | ||
- name: Set release repo | ||
shell: bash | ||
run: echo "REPO=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV | ||
# override version with GITHUB_SHA if tag-version set to false | ||
# this way only GITHUBSHA is tagged with this build | ||
- name: Override version if not official build | ||
shell: bash | ||
if: ${{ inputs.tag-version == 'false' }} | ||
run: echo "VERSION=$GITHUB_SHA" >> $GITHUB_ENV | ||
|
||
# build and push images tagged with GITHUB_SHA, version | ||
- name: Build and push tornjak images | ||
shell: bash | ||
run: make release-images | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ jobs: | |
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.53 | ||
version: v1.57.2 | ||
args: --timeout 7m | ||
|
||
- name: Build binaries | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: Tornjak Artifact push | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- v1.5 | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
workflow_dispatch: {} | ||
jobs: | ||
tornjak-build: | ||
alpine-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Show trigger info | ||
|
@@ -20,65 +20,60 @@ jobs: | |
- name: Check out repository code | ||
uses: actions/[email protected] | ||
|
||
- name: Install Golang | ||
uses: actions/[email protected] | ||
- name: Log in to GHCR.io | ||
uses: docker/[email protected] | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: true | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download modules | ||
run: go mod download | ||
- name: Get branch name | ||
id: branch_name | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
|
||
- uses: actions/[email protected] | ||
- name: Run build | ||
uses: ./.github/actions/build | ||
with: | ||
node-version: '18' | ||
tag-version: ${{ contains(fromJSON('["main", "v1.6"]'), steps.branch_name.outputs.branch) && true || false }} | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Download modules | ||
run: go mod download | ||
- name: Print job result | ||
run: | | ||
cat <<EOF >>"${GITHUB_STEP_SUMMARY}" | ||
- 🍏 This job's status is ${{ job.status }}. | ||
EOF | ||
ubi-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Show trigger info | ||
run: | | ||
cat <<EOF >>"${GITHUB_STEP_SUMMARY}" | ||
# Workflow job info | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.53 | ||
args: --timeout 7m | ||
- 🎉 The job was automatically triggered by a ${{ github.event_name }} event. | ||
- 🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub! | ||
- 🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}. | ||
EOF | ||
- name: Check out repository code | ||
uses: actions/[email protected] | ||
- name: Log in to GHCR.io | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# set repo and GITHUB SHA | ||
- name: Set github commit id | ||
run: echo "GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV | ||
|
||
- name: Set release repo | ||
run: echo "REPO=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV | ||
|
||
# build and push images tagged with GITHUB_SHA, version | ||
- name: Build and push tornjak images | ||
run: make release-images | ||
|
||
# build and push UBI images | ||
- name: Add ubi prefix | ||
run: echo "IMAGE_TAG_PREFIX=ubi-" >> $GITHUB_ENV | ||
- name: Set frontend Dockerfile | ||
run: echo "DOCKERFILE_FRONTEND=frontend/Dockerfile.frontend-container.ubi" >> $GITHUB_ENV | ||
- name: Set backend Dockerfile | ||
run: echo "DOCKERFILE_BACKEND=Dockerfile.backend-container.ubi" >> $GITHUB_ENV | ||
- name: Get branch name | ||
id: branch_name | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
|
||
- name: Build and push UBI images | ||
run: make release-images | ||
- name: Run build | ||
uses: ./.github/actions/build | ||
with: | ||
image-tag-prefix: ubi- | ||
backend-dockerfile: Dockerfile.backend-container.ubi | ||
frontend-dockerfile: frontend/Dockerfile.frontend-container.ubi | ||
tag-version: ${{ contains(fromJSON('["main", "v1.6"]'), steps.branch_name.outputs.branch) && true || false }} | ||
|
||
- name: Print job result | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.