This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
Publish #1
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: Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref || github.ref }} | |
- name: Setup AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ECR }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ECR }} | |
aws-region: us-east-1 | |
- name: Login to ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Create ECR repo | |
run: | | |
createEcr() { | |
aws ecr describe-repositories --repository-names $1 || \ | |
aws ecr create-repository \ | |
--repository-name $1 \ | |
--tags Key=src_repo,Value=${{ github.repository }} \ | |
Key=responsible,Value=devops \ | |
--image-scanning-configuration scanOnPush=true | |
aws ecr set-repository-policy \ | |
--repository-name $1 \ | |
--policy-text file://deploy/ecr-repo-policy.json | |
} | |
createEcr "service-pro-workflow" | |
# - name: Set up Docker Buildx | |
- uses: depot/setup-action@v1 | |
- name: Build | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
build-args: | | |
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core | |
tags: latest | |
labels: latest |