-
Notifications
You must be signed in to change notification settings - Fork 97
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
9 changed files
with
128 additions
and
22 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,51 @@ | ||
name: "Build embedgenerator container" | ||
description: "build embed generator container" | ||
inputs: | ||
githubToken: | ||
required: true | ||
description: github token | ||
githubActor: | ||
required: true | ||
description: github actor | ||
githubRepo: | ||
required: true | ||
description: github repo | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build UI | ||
working-directory: ./ui | ||
shell: bash | ||
run: yarn workspace @gcsim/embed build | ||
|
||
- name: List UI dist | ||
working-directory: ./ui/packages/embed/dist | ||
shell: bash | ||
run: ls -lh | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.githubActor }} | ||
password: ${{ inputs.githubToken }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ghcr.io/${{ inputs.githubRepo }} | ||
|
||
- name: Build go executable | ||
working-directory: ./cmd/services/embedgenerator | ||
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build . | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: . | ||
file: ./build/docker/embedgenerator/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,42 @@ | ||
name: deployment build | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
# this should be changed to on main pr + specific tags | ||
- containers | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get branch names | ||
id: branch-name | ||
uses: tj-actions/branch-names@v7 | ||
|
||
# grab latest sha | ||
- name: Setup Environment (PR) | ||
if: ${{ github.event_name == 'pull_request' }} | ||
shell: bash | ||
run: | | ||
echo "LAST_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> ${GITHUB_ENV} | ||
- name: Setup Environment (Push) | ||
if: ${{ github.event_name == 'push' }} | ||
shell: bash | ||
run: | | ||
echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV} | ||
# setup + test go and yarn | ||
- uses: actions/checkout@v3 | ||
- name: go-setup-and-test | ||
uses: ./.github/actions/go-setup-and-test | ||
- name: yarn-setup-and-test | ||
uses: ./.github/actions/yarn-setup-and-test | ||
|
||
# embed container | ||
- name: build embedgenerator container | ||
uses: ./.github/actions/containers/embedgenerator | ||
with: | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
githubActor: $${{ github.actor}} | ||
githubRepo: $${{ github.repository }} |
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
*.pprof | ||
.DS_Store | ||
/*.txt | ||
/build/* | ||
*.out | ||
!.keep | ||
out.json | ||
|
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,6 @@ | ||
cd ui | ||
yarn workspace @gcsim/embed build | ||
cd .. | ||
cd cmd/services/embedgenerator | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build . | ||
docker build -f build/docker/embedgenerator/Dockerfile --no-cache --progress=plain |
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,7 @@ | ||
FROM alpine:3.16.3 | ||
WORKDIR / | ||
ADD ui/packages/embed/dist /dist | ||
COPY cmd/services/embedgenerator/embedgenerator /embedgenerator | ||
RUN chmod +x /embedgenerator | ||
RUN ls -la | ||
ENTRYPOINT ["embedgenerator"] |
This file was deleted.
Oops, something went wrong.
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