Skip to content

Commit

Permalink
Move serverless deployment files into subfolder (#6)
Browse files Browse the repository at this point in the history
* Set logging level from environment variable

* Serverless ignore package patterns

* Fix variables inconsistency

* Set deployment bucket as environment variable

* Limit maximum number of serverless deployments

* Update sls workflows

* Move serverless deployment files into subfolder

---------

Co-authored-by: Albert Ribas <[email protected]>
  • Loading branch information
aribasadme and albertribasflix committed Jul 18, 2024
1 parent a2d7ce7 commit b03fd8d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/sls-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ on:
- main

jobs:
sls-deploy-prod:
name: Serverless Deploy Prod
sls-deploy:
name: Serverless Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/serverless/
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: create-json
- name: Create JSON
id: create-json
uses: jsdaniell/[email protected]
with:
name: "service-account-credentials.json"
json: ${{ secrets.SERVICE_ACCOUNT_CREDENTIALS }}
- run: |
dir: "serverless/"
- name: Deploy created JSON
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git add .
Expand All @@ -36,12 +41,13 @@ jobs:
- name: serverless install plugins
uses: serverless/[email protected]
with:
args: -c "serverless plugin install --name serverless-python-requirements"
args: -c "cd ./serverless && serverless plugin install --name serverless-python-requirements"
entrypoint: /bin/sh
- name: serverless deploy
uses: serverless/[email protected]
with:
args: deploy --stage ${{ env.CI_ENV }}
args: -c "cd ./serverless && serverless deploy --stage ${{ env.CI_ENV }} --verbose"
entrypoint: /bin/sh
env:
CI_ENV: prod
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/sls-remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Serverless Remove
on: workflow_dispatch

jobs:
sls-remove-prod:
name: Serverless Remove Prod
sls-remove:
name: Serverless Remove
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,7 +25,8 @@ jobs:
- name: serverless remove
uses: serverless/[email protected]
with:
args: remove --stage ${{ env.CI_ENV }}
args: -c "cd ./serverless && serverless remove --stage ${{ env.CI_ENV }} --verbose"
entrypoint: /bin/sh
env:
CI_ENV: prod
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b03fd8d

Please sign in to comment.