-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from luthersystems/sam-at-luther/Add_release_pi…
…peline Add docker release
- Loading branch information
Showing
9 changed files
with
178 additions
and
16 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,38 @@ | ||
name: Build Docker Images | ||
description: A custom action to build Docker images for specified platforms and images | ||
inputs: | ||
arch: | ||
description: The platform architecture | ||
required: true | ||
image: | ||
description: The image to build | ||
required: true | ||
git_tag: | ||
description: Git release tag | ||
default: '' | ||
git_rev: | ||
description: Git commit hash | ||
default: '' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Configure DockerHub | ||
uses: ./.github/actions/configure-dockerhub | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
platforms: linux/${{ inputs.arch }} | ||
|
||
- name: Build docker image for ${{ inputs.arch }} | ||
shell: bash | ||
run: | | ||
TARGET="" | ||
if [[ -n "${{ inputs.git_tag }}" ]]; then | ||
TARGET="push" | ||
fi | ||
cd ${{ inputs.image }} && make PLATFORMS=linux/${{ inputs.arch }} TAG_SUFFIX=-${{ inputs.arch }} GIT_TAG=${{ inputs.git_tag }} GIT_REVISION=${{ inputs.git_rev }} $TARGET |
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,10 @@ | ||
name: configure-dockerhub | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Configure Docker Hub | ||
run: |- | ||
[ -z "$DOCKERHUB_USERNAME" ] && exit 0 | ||
[ -z "$DOCKERHUB_TOKEN" ] && exit 0 | ||
docker login --username $DOCKERHUB_USERNAME --password=$DOCKERHUB_TOKEN | ||
shell: bash |
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,15 +1,31 @@ | ||
name: CI Test | ||
name: CI Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
build: | ||
name: ${{ matrix.image }} - ${{ matrix.arch }} docker build | ||
runs-on: ${{ fromJSON('{"arm64":"buildjet-2vcpu-ubuntu-2204-arm","amd64":"ubuntu-20.04"}')[matrix.arch] }} | ||
container: | ||
image: luthersystems/build-go:v0.0.68 | ||
strategy: | ||
matrix: | ||
arch: | ||
- amd64 | ||
- arm64 | ||
image: | ||
- pushprox | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Run CI | ||
run: make citest | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # include tags for VERSION detection | ||
- name: Run CI | ||
run: make citest | ||
- name: Build container | ||
uses: ./.github/actions/build-docker-images | ||
with: | ||
arch: ${{ matrix.arch }} | ||
image: . | ||
git_rev: $GITHUB_SHA |
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,44 @@ | ||
name: Build Release and Push | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
env: | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} | ||
jobs: | ||
build-push: | ||
name: ${{ matrix.image }} - ${{ matrix.arch }} docker build | ||
runs-on: ${{ fromJSON('{"arm64":"buildjet-2vcpu-ubuntu-2204-arm","amd64":"ubuntu-20.04"}')[matrix.arch] }} | ||
container: | ||
image: luthersystems/build-go:v0.0.68 | ||
strategy: | ||
matrix: | ||
arch: | ||
- amd64 | ||
- arm64 | ||
image: | ||
- pushprox | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # include tags for VERSION detection | ||
- name: Build container | ||
uses: ./.github/actions/build-docker-images | ||
with: | ||
arch: ${{ matrix.arch }} | ||
image: . | ||
git_tag: $GITHUB_REF_NAME | ||
push-manifests: | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- build-push | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Configure DockerHub | ||
uses: ./.github/actions/configure-dockerhub | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Create and push manifest for multiarch | ||
run: make push-manifests GIT_TAG=$GITHUB_REF_NAME |
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 @@ | ||
build |
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,5 @@ | ||
FROM golang:alpine | ||
COPY build/proxy /opt/ | ||
WORKDIR /opt | ||
ENTRYPOINT [ "/opt/proxy" ] | ||
CMD [ "--listen=:8080" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
proxy |