-
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.
Add client dockerfile and cd workflow
- Loading branch information
1 parent
a414833
commit 95e25ca
Showing
2 changed files
with
67 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,44 @@ | ||
name: Clients CD | ||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
# - cron: '38 19 * * *' # run the cron job every day at 19.38 | ||
# push: | ||
# branches: | ||
# - "main" | ||
# tags-ignore: | ||
# - "**" | ||
# paths: | ||
# - "clients/**" | ||
# - ".github/workflows/**" | ||
# - ".github/actions/**" | ||
env: | ||
REGISTRY: ghcr.io | ||
jobs: | ||
build-and-push-blackjack-frontend: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/sahinakkaya/blackjack-frontend | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: client | ||
file: client/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,23 @@ | ||
# Use the official Node.js image with Alpine Linux | ||
FROM node:20-alpine | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy package.json and yarn.lock to the working directory | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install dependencies using Yarn | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application for production | ||
RUN yarn build | ||
|
||
# Expose the port the app runs on (optional) | ||
EXPOSE 3000 | ||
|
||
# Define the command to run the app | ||
CMD ["yarn", "start"] |