Acknowledge Helm #122
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: | |
permissions: | |
actions: read | |
contents: read | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v3.0.0 | |
- run: npm ci --legacy-peer-deps | |
- uses: nrwl/nx-set-shas@v4 | |
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | |
- run: npx nx affected -t lint test build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Log in to Amazon ECR | |
run: | | |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 905418201315.dkr.ecr.us-east-1.amazonaws.com | |
- name: Build and push all images to ECR | |
run: | | |
IMAGES=( | |
"jobs apps/jobs/Dockerfile" | |
"executor apps/executor/Dockerfile" | |
"auth apps/auth/Dockerfile" | |
"products apps/products/Dockerfile" | |
) | |
for image in "${IMAGES[@]}"; do | |
NAME=$(echo $image | cut -d' ' -f1) | |
DOCKERFILE=$(echo $image | cut -d' ' -f2) | |
{ | |
docker build \ | |
--tag 905418201315.dkr.ecr.us-east-1.amazonaws.com/jobber/$NAME:latest \ | |
-f $DOCKERFILE \ | |
. && docker push 905418201315.dkr.ecr.us-east-1.amazonaws.com/jobber/$NAME:latest | |
} & | |
done | |
wait |