Skip to content

Commit

Permalink
feat(workflow): add step to save version for reuse in Package and Pub…
Browse files Browse the repository at this point in the history
…lish

- Added a step in the `semantic-release` job to save the version.
- Reused the saved version in the `package` job for consistent versioning.
  • Loading branch information
yacosta738 committed Sep 30, 2024
1 parent b7a8159 commit c36c0ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy-main-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ jobs:
uses: ./.github/actions/install/node

- name: Run Semantic Release
id: semantic-release
run: |
npx semantic-release
echo "VERSION=$(cat gradle.properties | grep "version =" | cut -d'=' -f2)" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ env.CI_GITHUB_TOKEN }}

Expand All @@ -213,13 +215,13 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

- name: Package, Publish and Deploy ${{ github.repository }} version ${{ steps.get_data.outputs.version }}
- name: Package, Publish and Deploy ${{ github.repository }} version ${{ env.VERSION }}
uses: ./.github/actions/docker
with:
deliver: true
registry: ${{ env.REGISTRY }}
image_name: ${{ env.IMAGE_NAME }}
version: ${{ steps.get_data.outputs.version != '' && steps.get_data.outputs.version || github.sha }}
version: ${{ env.VERSION }}
ci_github_token: ${{ env.CI_GITHUB_TOKEN }}
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:21-slim AS base
FROM node:21-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand All @@ -22,20 +22,20 @@ COPY --from=build /prod/lyra-app /prod/lyra-app-dev
WORKDIR /prod/lyra-app-dev

# Expose port for Nuxt server
EXPOSE 8000
EXPOSE 3000

# Start the Nuxt server
CMD [ "pnpm", "run", "start" ]

# Application image for lyra-app (Nuxt)
FROM base AS lyra-app
FROM gcr.io/distroless/nodejs22-debian12 AS lyra-app
COPY --from=build /usr/src/app/apps/frontend/apps/lyra-app/.output /prod/lyra-app
WORKDIR /prod/lyra-app
# Expose port for Nuxt server
EXPOSE 3000
EXPOSE 3000/tcp

# Start node server
CMD [ "node", "./server/index.mjs" ]
CMD [ "./server/index.mjs" ]

# Application image for lyra-landing-page-dev (Astro)
FROM base AS lyra-landing-page-dev
Expand All @@ -50,7 +50,7 @@ EXPOSE 4321
CMD [ "pnpm", "run", "start" ]

# Application image for lyra-landing-page (Astro)
FROM base AS lyra-landing-page
FROM gcr.io/distroless/nodejs22-debian12 AS lyra-landing-page
COPY --from=build /usr/src/app/apps/frontend/apps/lyra-landing-page/dist /prod/lyra-landing-page
WORKDIR /prod/lyra-landing-page

Expand All @@ -59,5 +59,4 @@ ENV PORT=4321
EXPOSE 4321

# Start node server
#CMD ["node", "./server/entry.mjs"]
CMD ["node", "./server/entry.mjs"]
CMD ["./server/entry.mjs"]

0 comments on commit c36c0ee

Please sign in to comment.