mirror of
https://github.com/morbalint/kemkas.git
synced 2026-07-17 19:03:46 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ffa0c24fd7 | |||
| ebe70f9446 | |||
| 26857ef8d5 |
@@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js 18.x
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.x
|
||||
- name: Cache NPM packages
|
||||
@@ -130,6 +130,29 @@ jobs:
|
||||
docker push registry.digitalocean.com/kemkas/kemkas-be:${GITHUB_SHA::8}
|
||||
docker push ghcr.io/${{ github.repository_owner }}/kemkas-be:${GITHUB_SHA::8}
|
||||
|
||||
docker-composit-build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- docker-be-build
|
||||
- docker-fe-build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to GitHub Container Registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
- uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Kemkas.Web/Composite.Dockerfile
|
||||
args: FE_TAG=${GITHUB_SHA::8},BE_TAG=${GITHUB_SHA::8}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
push: false
|
||||
load: true
|
||||
tags: ghcr.io/${{ github.repository_owner }}/kemkas/kemkas-composite:${GITHUB_SHA::8}
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
@@ -162,8 +185,13 @@ jobs:
|
||||
export DOCKER_IMAGE_ID=$(docker images ghcr.io/${{ github.repository_owner }}/kemkas:${GITHUB_SHA::8} --format "{{.ID}}")
|
||||
export DOCKER_IMAGE_ID=GHCR-$DOCKER_IMAGE_ID
|
||||
echo "DOCKER_IMAGE_ID=$DOCKER_IMAGE_ID" >> $GITHUB_ENV
|
||||
- name: Tag commit
|
||||
uses: tvdias/github-tagger@v0.0.1
|
||||
- name: Tag commit with docker image ID
|
||||
uses: actions/github-script@v5
|
||||
with:
|
||||
repo-token: "${{ github.token }}"
|
||||
tag: "${{ env.DOCKER_IMAGE_ID }}"
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: "refs/tags/${{ env.DOCKER_IMAGE_ID }}",
|
||||
sha: context.sha
|
||||
})
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
ARG FE_TAG=latest
|
||||
ARG BE_TAG=latest
|
||||
|
||||
FROM ghcr.io/morbalint/kemkas-fe:${FE_TAG} as frontend
|
||||
FROM ghcr.io/morbalint/kemkas-be:${BE_TAG} as backend
|
||||
|
||||
FROM base AS final
|
||||
COPY --from=backend /app .
|
||||
COPY --from=frontend /usr/share/nginx/html ./wwwroot
|
||||
ENTRYPOINT ["dotnet", "Kemkas.Web.dll"]
|
||||
Reference in New Issue
Block a user