chore: test script with test credentials #11
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: "Pre Deployment Script" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
pre_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pull Repository | |
uses: actions/checkout@v2 | |
- name: Setup and Install Node.Js | |
uses: actions/[email protected] | |
with: | |
node-version: "18.x" | |
cache: "yarn" | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build Application | |
run: | | |
yarn run app:build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.REGION }} | |
- name: Build and Push Docker Image to Amazon ECR | |
run: | | |
aws ecr get-login-password --region ${{ secrets.REGION }} | docker login --username AWS --password-stdin ${{ secrets.REGISTRY_URL }} | |
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest -f Dockerfile . | |
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest | |
- name: Deploy to Lambda | |
run: | | |
aws lambda update-function-code --function-name ${{ secrets.FUNCTION_NAME }} --image-uri ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest |