Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build artifacts CI #31

Merged
merged 2 commits into from
Sep 14, 2021
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
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/master-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tornjak Artifact push
on:
push:
branches:
- main
jobs:
tornjak-build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Golang
uses: actions/setup-go@v1
with:
go-version: '1.15.5'
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: --timeout 5m
- name: Log in to GHCR.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +27 to +32
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evan2645 this works perfectly, if we want to move our images to ghcr.io.

# Create sha tagged image for container-agent
- name: Set Image names
run: echo "CONTAINER_TAG=ghcr.io/${{ github.repository_owner }}/tornjak-spire-server:$GITHUB_SHA" >> $GITHUB_ENV
- name: Build and push tornjak agent image
run: make container-agent-push
# Create tagged versioned images
- name: Push artifacts for container-agent-multiversions
run: make release-container-agent-multiversions-ghcr
- run: echo "🍏 This job's status is ${{ job.status }}."
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

CONTAINER_TAG ?= tsidentity/tornjak-spire-server:latest
CONTAINER_VERSION_IMAGEPATH ?= tsidentity/tornjak-spire-server
CONTAINER_VERSION_GHCR_IMAGEPATH ?= ghcr.io/spiffe/tornjak-spire-server
CONTAINER_MANAGER_TAG ?= tsidentity/tornjak-manager:latest
GO_FILES := $(shell find . -type f -name '*.go' -not -name '*_test.go' -not -path './vendor/*')

Expand Down Expand Up @@ -53,6 +54,12 @@ release-container-agent-multiversions: bin/tornjak-agent ui-agent
./build-and-push-versioned-container.sh $$i ${CONTAINER_VERSION_IMAGEPATH}; \
done

release-container-agent-multiversions-ghcr: bin/tornjak-agent ui-agent
for i in $(shell cat SPIRE_BUILD_VERSIONS); do \
./build-and-push-versioned-container.sh $$i ${CONTAINER_VERSION_GHCR_IMAGEPATH}; \
done


clean:
rm -rf bin/
rm -rf tornjak-frontend/build
Expand Down
14 changes: 7 additions & 7 deletions SPIRE_BUILD_VERSIONS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
1.0.1
1.0.0
0.12.1
0.12.0
0.11.3
0.11.2
0.11.1
0.11.0
0.11.1
0.11.2
0.11.3
0.12.0
0.12.1
1.0.0
1.0.1