-
Notifications
You must be signed in to change notification settings - Fork 28
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
1 parent
e727bd6
commit 55ccab1
Showing
2 changed files
with
62 additions
and
18 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 |
---|---|---|
|
@@ -7,48 +7,50 @@ env: | |
|
||
on: | ||
pull_request: | ||
branches: ['master', 'main'] | ||
paths-ignore: ['docs/**'] | ||
branches: [ "master", "main", "dev" ] | ||
paths-ignore: [ "docs/**" ] | ||
|
||
push: | ||
branches: ['master', 'main'] | ||
paths-ignore: ['docs/**'] | ||
branches: [ "master", "main", "dev" ] | ||
paths-ignore: [ "docs/**" ] | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@v3.5.3 | ||
|
||
- name: Set up Python | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
# Consider using pre-commit.ci for open source project | ||
- name: Run pre-commit | ||
python-version: 3.8 | ||
|
||
# Run all pre-commit hooks on all the files. | ||
# Getting only staged files can be tricky in case a new PR is opened | ||
# since the action is run on a branch in detached head state | ||
- name: Install and Run Pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
# With no caching at all the entire ci process takes 3m to complete! | ||
# With no caching at all the entire ci process takes 4m 30s to complete! | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout Code Repository | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@v3.5.3 | ||
|
||
- name: Build the Stack | ||
run: docker compose -f local.yml build django | ||
run: docker compose -f local.yml build | ||
|
||
- name: Run DB Migrations | ||
run: docker compose -f local.yml run --rm django python manage.py migrate | ||
run: docker compose -f local.yml run --rm django python manage.py migrate | ||
|
||
- name: Run Django Tests | ||
run: docker compose -f local.yml run django pytest | ||
run: docker compose -f local.yml run django pytest | ||
|
||
- name: Tear down the Stack | ||
run: docker compose -f local.yml down | ||
run: docker compose -f local.yml down |
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,42 @@ | ||
name: Docker Builds | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'dev' | ||
tags: | ||
- 'v*' | ||
|
||
pull_request: | ||
branches: | ||
- 'master' | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: crazy-max/[email protected] | ||
with: | ||
images: dudanogueira/rocket.connect | ||
- | ||
name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./compose/production/django/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |