xc-admin-frontend-image-push.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. name: Build and Push Cross Chain Admin Frontend
  2. on:
  3. push:
  4. branches: [main]
  5. paths: [governance/xc_admin/**]
  6. permissions:
  7. contents: read
  8. id-token: write
  9. jobs:
  10. xc-admin-image:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Set image tag to timestamp and shortened commit hash
  15. run: |
  16. SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
  17. TIMESTAMP=$(date +%s)
  18. echo "IMAGE_TAG=${TIMESTAMP}-${SHORT_HASH}" >> "${GITHUB_ENV}"
  19. - uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
  20. with:
  21. role-to-assume: arn:aws:iam::192824654885:role/github-actions-ecr
  22. aws-region: eu-west-2
  23. - uses: aws-actions/amazon-ecr-login@v1
  24. id: ecr_login
  25. - run: |
  26. DOCKER_BUILDKIT=1 docker build -t lerna -f tilt_devnet/docker_images/Dockerfile.lerna .
  27. DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f governance/xc_admin/packages/xc_admin_frontend/Dockerfile .
  28. docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
  29. env:
  30. ECR_REGISTRY: ${{ steps.ecr_login.outputs.registry }}
  31. ECR_REPOSITORY: xc-admin-frontend