forked from GoogleCloudPlatform/cloud-code-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update GitHub Actions workflow for Python Dj
- Loading branch information
1 parent
b1757e4
commit 4c48e9e
Showing
1 changed file
with
46 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,46 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run migrations | ||
run: python manage.py migrate | ||
|
||
- name: Run tests | ||
run: python manage.py test | ||
|
||
- name: Publish artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-guestbook-artifacts | ||
path: | | ||
staticfiles/ | ||
.coverage | ||
- name: Deploy to production | ||
uses: some-action-for-deployment@v1 | ||
with: | ||
environment: production | ||
secret-key: ${{ secrets.PRODUCTION_SECRET_KEY }} | ||
database-url: ${{ secrets.PRODUCTION_DATABASE_URL }} |