我正在尝试为我的GitHub代码库设置持续集成(CI)。在sandbox分支中每次推送后,我想构建一个Docker镜像并推送到AWS ECR。
这是我的.github/workflows/aws.yml文件 -
name: be-harvester CI
on:
pull_request:
branches:
- sandbox
push:
branches:
- sandbox
env:
AWS_REPOSITORY_URL: ${{ secrets.AWS_REPOSITORY_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
build-and-push:
name: Build and push image to AWS ECR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Check REPO url
run: echo $AWS_REPOSITORY_URL
- name: Setup ECR
run: $( aws ecr get-login --no-include-email --region ap-south-1)
- name: Build and tag the image
run: docker build -t $AWS_REPOSITORY_URL .
- name: Push
run: docker push $REPOSITORY_URL
这个错误的原因是什么?