Test, build and deploy #72
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: Test, lint, build, push | |
on: workflow_dispatch | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
test: | |
name: "Test" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::233044492909:role/SkillsTracker-GitHubActions | |
aws-region: eu-west-2 | |
- name: Configure DVC | |
run: bash scripts/configure_dvc.sh | |
- name: Test dev | |
run: bash scripts/test-dev.sh | |
lint: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dev poetry env | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run pre-commit | |
run: | | |
poetry run pre-commit run --all-files | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::233044492909:role/SkillsTracker-GitHubActions | |
aws-region: eu-west-2 | |
- name: Configure DVC | |
run: bash scripts/configure_dvc.sh | |
- name: Build containers | |
run: bash scripts/build-prod.sh | |
push: | |
name: "Push" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: arn:aws:iam::233044492909:role/SkillsTracker-GitHubActions | |
aws-region: eu-west-2 | |
- name: Push to ECR | |
run: bash scripts/push-prod.sh |