-
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.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 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,37 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# ignore changes to infra/app/values.auto-updated.yaml (this file is updated by the CI workflow itself) | ||
paths-ignore: | ||
- infra/app/values.auto-updated.yaml | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCKER_APP_IMAGE_NAME: "ghcr.io/whiletrue-industries/ckangpt-ui/ckangpt-ui" | ||
run: | | ||
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u whiletrue-industries --password-stdin &&\ | ||
if docker pull "${DOCKER_APP_IMAGE_NAME}:latest"; then | ||
CACHE_FROM_ARG="--cache-from ${DOCKER_APP_IMAGE_NAME}:latest" | ||
else | ||
CACHE_FROM_ARG="" | ||
fi &&\ | ||
docker build $CACHE_FROM_ARG --build-arg VERSION=${GITHUB_SHA} -t app . &&\ | ||
docker tag app "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
docker push "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\ | ||
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then | ||
docker tag app "${DOCKER_APP_IMAGE_NAME}:latest" &&\ | ||
docker push "${DOCKER_APP_IMAGE_NAME}:latest" &&\ | ||
echo "ui:" > infra/app/values.auto-updated.yaml &&\ | ||
echo " image: ${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" >> infra/app/values.auto-updated.yaml &&\ | ||
# commit and push the updated values.auto-updated.yaml file | ||
git config --global user.name "ckangpt-ui CI" &&\ | ||
git config --global user.email "ckangpt-ui-ci@localhost" &&\ | ||
git add infra/app/values.auto-updated.yaml &&\ | ||
git commit -m "automatic update of ckangpt-ui" &&\ | ||
git push origin main | ||
fi |
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,12 @@ | ||
# Pulled Aug 29, 2023 | ||
FROM node:18@sha256:11e9c297fc51f6f65f7d0c7c8a8581e5721f2f16de43ceff1a199fd3ef609f95 as build | ||
WORKDIR /srv | ||
COPY package-lock.json package.json ./ | ||
RUN npm install | ||
COPY angular.json tsconfig.json ./ | ||
COPY projects ./projects | ||
RUN node_modules/.bin/ng build | ||
|
||
# Pulled Aug 29, 2023 | ||
FROM nginx@sha256:104c7c5c54f2685f0f46f3be607ce60da7085da3eaa5ad22d3d9f01594295e9c | ||
COPY --from=build /srv/dist/ckangpt /usr/share/nginx/html |
Empty file.