diff --git a/.github/workflows/deploy-images.yml b/.github/workflows/deploy-images.yml index 1b95df4..a9441b7 100644 --- a/.github/workflows/deploy-images.yml +++ b/.github/workflows/deploy-images.yml @@ -3,15 +3,18 @@ name: Deploy All Images env: REGISTRY: ghcr.io IMAGE_NAME: numerai_predict + MODEL_UPLOADS_ECR_ACCOUNT_ID: ${{ github.ref == 'refs/heads/staging' && secrets.MODEL_UPLOADS_STAGING_ACCOUNT_ID || secrets.MODEL_UPLOADS_ACCOUNT_ID }} on: workflow_dispatch: push: branches: - master + - staging jobs: public-images: + if: github.ref == 'refs/heads/master' strategy: matrix: python-version: ['3{0}10', '3{0}11', '3{0}12', '3{0}13'] @@ -63,6 +66,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} internal-images: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging' strategy: matrix: python-version: ['3{0}10', '3{0}11', '3{0}12', '3{0}13'] @@ -76,7 +80,7 @@ jobs: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: arn:aws:iam::${{ secrets.MODEL_UPLOADS_ACCOUNT_ID }}:role/github-actions + role-to-assume: arn:aws:iam::${{ env.MODEL_UPLOADS_ECR_ACCOUNT_ID }}:role/github-actions aws-region: us-west-2 - name: Set up QEMU @@ -86,4 +90,4 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and Push Docker Image - run: ACCOUNT_ID=${{ secrets.MODEL_UPLOADS_ACCOUNT_ID }} make push_latest_${{ format(matrix.python-version, '_') }} + run: ACCOUNT_ID=${{ env.MODEL_UPLOADS_ECR_ACCOUNT_ID }} make push_latest_${{ format(matrix.python-version, '_') }} diff --git a/.github/workflows/deploy-shell.yaml b/.github/workflows/deploy-shell.yaml index c41eaef..d9319e7 100644 --- a/.github/workflows/deploy-shell.yaml +++ b/.github/workflows/deploy-shell.yaml @@ -3,15 +3,18 @@ name: Deploy Shell Image (3.11 only) env: REGISTRY: ghcr.io IMAGE_NAME: numerai_predict + MODEL_UPLOADS_ECR_ACCOUNT_ID: ${{ github.ref == 'refs/heads/staging' && secrets.MODEL_UPLOADS_STAGING_ACCOUNT_ID || secrets.MODEL_UPLOADS_ACCOUNT_ID }} on: workflow_dispatch: push: branches: - master + - staging jobs: public-py311-image: + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest-4core permissions: packages: write @@ -34,7 +37,7 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}_shell - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -70,8 +73,8 @@ jobs: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: - role-to-assume: arn:aws:iam::${{ secrets.MODEL_UPLOADS_ACCOUNT_ID }}:role/github-actions + role-to-assume: arn:aws:iam::${{ env.MODEL_UPLOADS_ECR_ACCOUNT_ID }}:role/github-actions aws-region: us-west-2 - name: Build and Push Docker Image - run: ACCOUNT_ID=${{ secrets.MODEL_UPLOADS_ACCOUNT_ID }} make push_latest_shell + run: ACCOUNT_ID=${{ env.MODEL_UPLOADS_ECR_ACCOUNT_ID }} make push_latest_shell