Fix/pre deployment check #1
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
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/action-docker-layer-caching@v0.0.11 | |
# 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 |