Merge project setup with appropriate local dev environment settings #8
Workflow file for this run
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: Use hotosm workflows for pull requests and pushes to main or release branches | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release/*' | |
pull_request: | |
branches: | |
- 'main' | |
- 'release/*' | |
jobs: | |
build: | |
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main | |
if: github.event_name != 'pull_request' # Ensures this job runs for push events | |
with: | |
context: . | |
dockerfile: './Dockerfile.prod' | |
image_name: ghcr.io/${{ github.repository }}/backend:${{ github.sha }} | |
extra_build_args: | | |
APP_VERSION=${{ github.ref_name }} | |
COMMIT_REF=${{ github.sha }} | |
pytest: | |
uses: hotosm/gh-workflows/.github/workflows/test_pytest.yml@main | |
if: github.event_name != 'pull_request' # Ensures this job runs for push events | |
with: | |
image_name: ghcr.io/${{ github.repository }}/backend:${{ github.sha }} | |
extra_build_args: | | |
COMMIT_REF=${{ github.sha }} | |
build_pr: | |
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main | |
if: github.event_name == 'pull_request' # Runs this job only for pull requests | |
with: | |
context: . | |
dockerfile: './Dockerfile.dev' | |
image_name: ghcr.io/${{ github.repository }}/backend:pr-${{ github.event.pull_request.number }} | |
extra_build_args: | | |
APP_VERSION=${{ github.ref_name }} | |
COMMIT_REF=${{ github.sha }} | |
pytest_pr: | |
uses: hotosm/gh-workflows/.github/workflows/test_pytest.yml@main | |
if: github.event_name == 'pull_request' # Runs this job only for pull requests | |
with: | |
image_name: ghcr.io/${{ github.repository }}/backend:pr-${{ github.event.pull_request.number }} | |
extra_build_args: | | |
COMMIT_REF=${{ github.sha }} |