sort projects by score when its already scored #102
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: Deploy Dev | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
- '.vscode/**' | |
- 'deploy/**' | |
- 'terraform/**' | |
- 'db/**' | |
- 'notebooks/**' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
env: | |
AWS_REGION: eu-west-1 | |
REPO_ROOT: 387546586013.dkr.ecr.eu-west-1.amazonaws.com | |
REPO_URI: 387546586013.dkr.ecr.eu-west-1.amazonaws.com/course-management | |
steps: | |
- name: Prepare tags and repository info | |
id: prep | |
run: | | |
DATE=$(date +'%Y%m%d-%H%M%S') | |
SHORT_SHA=$(echo ${{ github.sha }} | cut -c 1-7) | |
echo "TAG=${DATE}-${SHORT_SHA}" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9.13' | |
- name: Install dependencies | |
run: | | |
pip install pipenv | |
pipenv install --deploy --ignore-pipfile | |
- name: Run tests | |
run: pipenv run python manage.py test courses.tests | |
- name: Build Docker image | |
run: docker build -t course_management:${{ env.TAG }} . | |
- name: Log in to Amazon ECR | |
run: | | |
aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin ${{ env.REPO_ROOT }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Push Docker image to Amazon ECR | |
run: | | |
docker tag course_management:${{ env.TAG }} ${{ env.REPO_URI }}:${{ env.TAG }} | |
docker push ${{ env.REPO_URI }}:${{ env.TAG }} | |
- name: Deploy to Dev Environment | |
run: bash deploy/deploy_dev.sh ${{ env.TAG }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ env.AWS_REGION }} |