-
Notifications
You must be signed in to change notification settings - Fork 456
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
75 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,41 @@ | ||
name: Continuous Deployment | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker login | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile.prod | ||
push: true | ||
tags: 100xdevs/job-board-staging:${{ github.sha }} | ||
|
||
- name: Clone staging-ops repo, update, and push | ||
env: | ||
PAT: ${{ secrets.STAGING_OPS_PAT }} | ||
run: | | ||
git clone https://github.com/code100x/staging-ops.git | ||
cd staging-ops | ||
sed -i 's|image: 100xdevs/job-board-staging:.*|image: 100xdevs/job-board-staging:${{ github.sha }}|' job-board/deployment.yaml | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
git add job-board/deployment.yaml | ||
git commit -m "Update job-board-staging image to ${{ github.sha }}" | ||
git push https://${PAT}@github.com/code100x/staging-ops.git main |
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,19 @@ | ||
|
||
FROM node:20-alpine AS build | ||
ARG DATABASE_URL | ||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN DATABASE_URL=$DATABASE_URL npx prisma generate | ||
RUN DATABASE_URL=$DATABASE_URL npm run build | ||
|
||
FROM node:20-alpine AS production | ||
WORKDIR /usr/src/app | ||
COPY --from=build /usr/src/app/.next ./.next | ||
COPY --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --from=build /usr/src/app/public ./public | ||
COPY --from=build /usr/src/app/package.json ./package.json | ||
CMD ["npm", "run", "start"] | ||
|
||
EXPOSE 3000 |
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,15 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `location` on the `Job` table. All the data in the column will be lost. | ||
- Added the required column `address` to the `Job` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `city` to the `Job` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Job" DROP COLUMN "location", | ||
ADD COLUMN "address" TEXT NOT NULL, | ||
ADD COLUMN "city" TEXT NOT NULL; | ||
|
||
-- DropEnum | ||
DROP TYPE "JobLocations"; |