fix: auto schedule export members #150
This file contains hidden or 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: aws-ecr-publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| AWS_REGION: us-east-1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: aws-ecr-publish | |
| runs-on: buildjet-4vcpu-ubuntu-2204-arm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Get ECR Registry | |
| id: ecr-login | |
| uses: aws-actions/amazon-ecr-login@v1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to ECR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ${{ steps.ecr-login.outputs.registry }} | |
| - name: Set up Docker Buildkit | |
| uses: docker/setup-buildx-action@v2 | |
| with: | |
| buildkitd-flags: --debug | |
| - name: Get Tags for Image | |
| id: metadata | |
| uses: docker/metadata-action@v3 | |
| with: | |
| images: ${{ steps.ecr-login.outputs.registry }}/clashperk-backend | |
| tags: | | |
| type=raw,value=latest | |
| - name: Docker Build, Tag and Push to ECR | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| platforms: linux/arm64 | |
| push: true | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| build-args: | | |
| GIT_SHA=${{ github.sha }} | |
| - name: Deploy | |
| uses: appleboy/ssh-action@v1.2.2 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} | |
| script: | | |
| cd api | |
| docker compose pull | |
| docker compose up -d |