Auto commit #20
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: Delivery | |
on: | |
push: | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
make install-ci | |
make install-test | |
- name: Run tests | |
run: | | |
make test | |
build-deployment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
# - name: Install dependencies | |
# run: | | |
# make install-ci | |
- name: Build Lambda Layer | |
run: make build-layer | |
- name: Archive .deployment folder | |
run: zip -r deployment.zip .deployment | |
- name: Upload deployment artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: deployment-${{ github.sha }} | |
path: deployment.zip | |
deploy-dev: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: | |
- unit-tests | |
- build-deployment | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Deploy to dev | |
uses: ./.github/actions/deploy | |
with: | |
workspace: default | |
sha: ${{ github.sha }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: us-east-1 | |
sentry_dsn: ${{ secrets.SENTRY_DSN }} | |
telegram_token: ${{ secrets.DEV_TELEGRAM_TOKEN }} | |
automation: | |
runs-on: ubuntu-latest | |
needs: | |
- deploy-dev | |
steps: | |
- name: Checkout automation repo | |
uses: actions/checkout@master | |
with: | |
repository: asaf-kali/the-spymaster-automation | |
token: ${{ secrets.AUTOMATION_REPO_PAT }} | |
path: automation | |
- name: Set up python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install CI dependencies | |
run: cd automation; make install-ci | |
- name: Install dependencies | |
run: cd automation; make install-test | |
- name: Run automation | |
run: cd automation; make test | |
deploy-prod: | |
runs-on: ubuntu-latest | |
needs: | |
- automation | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Deploy to prod | |
uses: ./.github/actions/deploy | |
with: | |
workspace: prod | |
sha: ${{ github.sha }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: us-east-1 | |
sentry_dsn: ${{ secrets.SENTRY_DSN }} | |
telegram_token: ${{ secrets.PROD_TELEGRAM_TOKEN }} |