Github Action Update Test 1 #83
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-deploy-infra: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-1 | |
- name: Setup SAM CLI | |
uses: aws-actions/setup-sam@v1 | |
- name: Run sam build | |
run: sam build | |
- name: Run sam deploy | |
run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset | |
- name: Debug Environment Variables | |
run: env | grep AWS | |
- name: Configure AWS credentials for S3 Sync | |
run: | | |
mkdir -p ~/.aws | |
echo "[default]" > ~/.aws/credentials | |
echo "aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials | |
echo "aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials | |
echo "[default]" > ~/.aws/config | |
echo "region = eu-west-1" >> ~/.aws/config | |
- name: Sync resume-site to S3 | |
uses: jakejarvis/[email protected] | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
SOURCE_DIR: 'resume-site' | |
AWS_S3_BUCKET: 'recreated-website2351' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: eu-west-1 | |
playwright-tests: | |
needs: build-and-deploy-infra | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
pip install pytest-playwright | |
playwright install | |
- name: Run Playwright tests | |
run: | | |
pytest -v tests/playwright-tests |