Skip to content

Commit

Permalink
feat: Initial CI/CD Beta Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanwilkes committed Feb 1, 2021
1 parent 4da1dd8 commit 988fc9a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# .dockerignore
Dockerfile
README.md
node_modules
npm-debug.log
19 changes: 19 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default:
image: google/cloud-sdk:alpine
before_script:
- gcloud config set project $GOOGLE_CLOUD_PROJECT
- gcloud auth activate-service-account --key-file $GOOGLE_CLOUD_CREDENTIALS

build-beta:
stage: build-beta
script:
- gcloud builds submit --tag gcr.io/$GOOGLE_CLOUD_PROJECT/gcs-radio-beta
only:
- beta

deploy-beta:
stage: deploy-beta
script:
- gcloud run deploy gcs-radio-beta --image gcr.io/$GOOGLE_CLOUD_PROJECT/gcs-radio-beta --platform managed --region us-west1 --allow-unauthenticated
only:
- beta
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Use the official lightweight Node.js 12 image.
# https://hub.docker.com/_/node
FROM node:12-alpine

# Create and change to the app directory.
WORKDIR /usr/src/app

# Copy application dependency manifests to the container image.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./

# Install production dependencies.
RUN npm install --only=production
RUN npm install

# Copy local code to the container image.
COPY . ./

RUN npm run build
RUN npm prune --production

# Run the web service on container startup.
CMD [ "npm", "start" ]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"clean": "rimraf build",
"rebuild": "npm run build",
"prerebuild": "npm run clean",
"prebuild": "npm run lint",
"test": "jest --colors --verbose",
"lint": "eslint \"src/**/*.[jt]s\" --fix"
},
Expand Down

0 comments on commit 988fc9a

Please sign in to comment.