-
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
2 changed files
with
22 additions
and
19 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 |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: | ||
- staging | ||
|
||
env: | ||
DEPLOYMENT: ticket-office | ||
DEPLOYMENT_NAMESPACE: ticket-office | ||
|
@@ -21,18 +20,29 @@ jobs: | |
- name: 🔑 Login Docker | ||
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
- name: Build client (Vite.js) | ||
run: | | ||
npm ci | ||
cd client | ||
npm run build --emptyOutDir --outDir '../server/public' | ||
- name: Build server (Bun) | ||
run: | | ||
cd server | ||
bun install | ||
docker build -t ${{ github.repository }} . | ||
IMAGE_ID=ghcr.io/${{ github.repository }} | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
docker tag ${{ github.repository }} $IMAGE_ID:staging | ||
docker push $IMAGE_ID:staging | ||
- name: Get Tag | ||
id: version | ||
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
|
||
- name: 📦 Push Docker image | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository }} | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
docker tag ${{ github.repository }} $IMAGE_ID:staging | ||
docker push $IMAGE_ID:staging | ||
deploy: | ||
name: 💭 Update staging deployment | ||
runs-on: ubuntu-latest | ||
|
@@ -55,7 +65,7 @@ jobs: | |
steps: | ||
- uses: dataesr/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ secrets.GITHUB_TOKEN}} | ||
mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | ||
mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL }} | ||
deployment_url: ${{ env.DEPLOYMENT_URL }} |
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 |
---|---|---|
@@ -1,19 +1,12 @@ | ||
FROM oven/bun AS builder | ||
FROM oven/bun | ||
|
||
WORKDIR /app | ||
|
||
COPY ./client/package.json ./client/ | ||
RUN cd client && npm ci | ||
|
||
COPY ./client ./client | ||
RUN cd client && npm run build --emptyOutDir --outDir '../server/public' | ||
|
||
COPY ./server/package.json ./server/ | ||
COPY ./server/package.json . | ||
RUN bun i --production | ||
COPY ./server ./server | ||
COPY ./server . | ||
|
||
ENV NODE_ENV=production | ||
CMD ["bun", "run", "index.ts"] | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["bun", "run", "server/index.ts"] | ||
EXPOSE 3000 |