Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/pre deployment check #27

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Buildpack Test

on:
pull_request:
branches:
- main

jobs:
build-and-test:
name: Build and Test using Heroku Buildpack
runs-on: ubuntu-latest
# if: github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR'

services:
docker:
image: docker:19.03.12-dind
options: --privileged
ports:
- 5000:5000

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# - name: Cache Docker layers
# uses: satackey/[email protected]
# continue-on-error: true

- name: Build Docker image
run: docker build -t myapp . -f Dockerfile.build

# - name: Run tests
# run: docker run myapp npm run test

- name: Run Docker container
run: docker run -d -p 5000:5000 myapp

- name: Check running app
run: curl http://localhost:5000
17 changes: 0 additions & 17 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ yarn-error.log*
.vscode

.idea
.cosine
.cosine
yarn.lock
17 changes: 17 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM heroku/heroku:22-build

WORKDIR /opt

RUN curl https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz | tar -xz

WORKDIR /app

COPY . .

WORKDIR /opt

RUN ./bin/compile /app /tmp/build-cache /tmp/env

EXPOSE 5000

CMD ["npm", "start"]
Loading
Loading