-
Notifications
You must be signed in to change notification settings - Fork 69
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
3ba540e
commit 37b1f36
Showing
12 changed files
with
150 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Multi-Environment Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- alpha | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Run tests | ||
run: python -m unittest | ||
|
||
deploy-dev: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: dev | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy to Development | ||
run: echo "Deploying to Development environment..." | ||
|
||
deploy-test: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy to Test | ||
run: echo "Deploying to Test environment..." | ||
|
||
deploy-prod: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
environment: prod | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy to Production | ||
run: echo "Deploying to Production environment..." |
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,33 @@ | ||
name: Install and cache dependencies | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Cache Python dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-python-${{ hashFiles('**/src/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-python- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r src/requirements.txt | ||
# Add additional steps for linting, testing, etc. |
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,37 @@ | ||
name: Python Matrix Testing | ||
|
||
on: | ||
push: | ||
branches: [ alpha ] | ||
pull_request: | ||
branches: [ alpha ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, 3.10] | ||
framework: ['flask', 'django'] | ||
include: | ||
- framework: 'flask' | ||
additional-package: 'Flask-Testing' | ||
- framework: 'django' | ||
additional-package: 'Django-Testing' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install ${{ matrix.additional-package }} | ||
- name: Run tests | ||
run: | | ||
if [ ${{ matrix.framework }} = 'flask' ]; then | ||
# run Flask tests | ||
elif [ ${{ matrix.framework }} = 'django' ]; then | ||
# run Django tests | ||
fi |
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,31 @@ | ||
name: Deployment with Approval Gates | ||
|
||
on: | ||
push: | ||
branches: | ||
- alpha | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Run tests | ||
run: python -m unittest | ||
|
||
deploy-to-prod: | ||
needs: build-and-test | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: production | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Deploy to Production | ||
run: echo "Deploying to production environment..." | ||
# Replace with actual deployment commands |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.