-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove circle and improve gha (#1089)
* Remove circle and improve gha * Main workflow * Tag workflow * deploy to siap integration independently --------- Co-authored-by: Nicolas Oudard <[email protected]>
- Loading branch information
Showing
5 changed files
with
168 additions
and
5 deletions.
There are no files selected for viewing
File renamed without changes.
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,40 @@ | ||
name: "Test and deploy to staging" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
DATABASE_URL: postgres://apilos:apilos@localhost:5432/apilos | ||
DB_READONLY: postgres://apilos:apilos@localhost:5432/apilos | ||
SECRET_KEY: secret-key | ||
DEBUG: False | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/run_tests.yml | ||
|
||
deploy_to_staging: | ||
name: "Deploy to Staging" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: apilos-staging | ||
known-host: ssh.osc-fr1.scalingo.com | ||
deploy_to_siap_integration: | ||
name: "Deploy to Siap Integration" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: apilos-siap-integration | ||
known-host: ssh.osc-fr1.scalingo.com |
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
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,67 @@ | ||
name: "Test and deploy to staging" | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
env: | ||
DATABASE_URL: postgres://apilos:apilos@localhost:5432/apilos | ||
DB_READONLY: postgres://apilos:apilos@localhost:5432/apilos | ||
SECRET_KEY: secret-key | ||
DEBUG: False | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/run_tests.yml | ||
|
||
deploy_to_production: | ||
name: "Deploy to Production" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: fabnum-apilos | ||
known-host: ssh.osc-fr1.scalingo.com | ||
|
||
deploy_to_siap_production: | ||
name: "Deploy to Siap Production" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: apilos-siap-production | ||
known-host: ssh.osc-fr1.scalingo.com | ||
|
||
deploy_to_siap_recette: | ||
name: "Deploy to Siap Recette" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: apilos-siap-recette | ||
known-host: ssh.osc-fr1.scalingo.com | ||
|
||
deploy_to_siap_ecole: | ||
name: "Deploy to Siap École" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: kolok/deploy-to-scalingo@v1 | ||
with: | ||
ssh-private-key: ${{ secrets.SCALINGO_SSH_PRIVATE_KEY }} | ||
app-name: apilos-siap-ecole | ||
known-host: ssh.osc-fr1.scalingo.com |
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,51 @@ | ||
on: | ||
workflow_call: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
DATABASE_URL: postgres://apilos:apilos@localhost:5432/apilos | ||
DB_READONLY: postgres://apilos:apilos@localhost:5432/apilos | ||
SECRET_KEY: secret-key | ||
DEBUG: False | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
|
||
# Service containers to run with `container-job` | ||
services: | ||
# Label used to access the service container | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: apilos | ||
POSTGRES_NAME: apilos | ||
POSTGRES_HOST: postgres | ||
POSTGRES_PASSWORD: apilos | ||
POSTGRES_PORT: 5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt -r dev-requirements.txt | ||
- name: Check migrations | ||
run: | | ||
python manage.py makemigrations --check --dry-run | ||
- name: Execute test | ||
run: | | ||
python manage.py test |