From dbd00618a564df516cd8f314406042d94c2cb8d3 Mon Sep 17 00:00:00 2001 From: Mauro Luzzatto Date: Tue, 6 Feb 2024 21:24:28 +0100 Subject: [PATCH] Optimize gha (#23) --- .../{sam-deploy.yaml => aws-sam-deploy.yaml} | 14 ++++++-------- .github/workflows/test-api.yaml | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) rename .github/workflows/{sam-deploy.yaml => aws-sam-deploy.yaml} (76%) diff --git a/.github/workflows/sam-deploy.yaml b/.github/workflows/aws-sam-deploy.yaml similarity index 76% rename from .github/workflows/sam-deploy.yaml rename to .github/workflows/aws-sam-deploy.yaml index d99b0e9..edfa9f5 100755 --- a/.github/workflows/sam-deploy.yaml +++ b/.github/workflows/aws-sam-deploy.yaml @@ -12,8 +12,6 @@ jobs: AWS_REGION: eu-west-1 STACK_NAME: musicflow-sam-app S3_BUCKET: portfolio-on-lambda-2999-v3 - CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} steps: - uses: actions/checkout@v3 - uses: aws-actions/setup-sam@v2 @@ -25,12 +23,12 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{env.AWS_REGION}} - # - name: Create env file - # run: | - # touch .env - # echo CLIENT_ID=${{ secrets.CLIENT_ID }} >> .env - # echo CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} >> .env - # cat .env + - name: Create env file + run: | + touch .env + echo CLIENT_ID=${{ secrets.CLIENT_ID }} >> .env + echo CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} >> .env + cat .env # Build inside Docker containers - run: sam build --use-container -t template.yaml diff --git a/.github/workflows/test-api.yaml b/.github/workflows/test-api.yaml index d5facba..b04d5eb 100755 --- a/.github/workflows/test-api.yaml +++ b/.github/workflows/test-api.yaml @@ -1,5 +1,6 @@ name: Tests on: [push] + jobs: run-api-tests: runs-on: ubuntu-latest