Skip to content

Update GHA workflow for test and deployment #1

Update GHA workflow for test and deployment

Update GHA workflow for test and deployment #1

Workflow file for this run

name: Preview Deployment

Check failure on line 1 in .github/workflows/pulumi.preview.yml

View workflow run for this annotation

GitHub Actions / Preview Deployment

Invalid workflow file

The workflow is not valid. .github/workflows/pulumi.preview.yml: Unexpected tag '!main'
on:
push:
branches:
- "*"
- !main
jobs:
test:
runs-on: ubuntu-latest
environment: Preview
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
cache: 'pip'
- run: pip install -r requirements.txt
- name: Run tests
run: pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
deploy:
runs-on: ubuntu-latest
environment: Preview
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
cache: 'pip'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: pip install -r requirements.txt
- name: Create Package for AWS Lambda Layer
run: |
zip -r package.zip python/lib/python3.12/site-packages
- uses: pulumi/actions@v5
with:
command: up
stack-name: staging
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
# - name: Deploy to AWS Lambda - Production
# if: env.ENVIRONMENT == 'Production'
# run: |
# aws lambda update-function-code --function-name prod-lta-datasets-updater --zip-file fileb://deployment_package.zip
# - name: Deploy
# run: |
# aws lambda update-function-code --function-name dev-lta-datasets-updater --zip-file fileb://deployment_package.zip