forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c97920
commit e86427c
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
name: Docker Push - Superset | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- feat-text-to-sql | ||
|
||
# workflow_run: | ||
# workflows: ["Tag"] | ||
# types: | ||
# - completed | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_and_push_superset_poc: | ||
name: Build & Push Superset Image - POC | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: write | ||
# if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set output | ||
id: vars | ||
run: echo "git_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT | ||
|
||
# configure iam | ||
- name: Configure IAM Role | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.POC_SUPERSET_DEPLOY_ARN }} | ||
aws-region: us-east-1 | ||
continue-on-error: false | ||
|
||
- name: Build, Tag, and Push | ||
run: | | ||
export IMAGE_TAG=${{ steps.vars.outputs.git_tag }} | ||
export ENVIRONMENT=poc | ||
./scrips/docker-build-tag-and-push.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# optional | ||
: "${AWS_REGION:=us-east-1}" | ||
: "${ENVIRONMENT:=poc}" | ||
|
||
## required | ||
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) | ||
: "${IMAGE_TAG:-$IMAGE_TAG}" | ||
|
||
ECR_REGISTRY_ENDPOINT="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com" | ||
IMAGE_NAME="$ECR_REGISTRY_ENDPOINT/superset-base" | ||
|
||
echo "Account: $AWS_ACCOUNT_ID" | ||
|
||
printf "\nECR Login...\n" | ||
aws ecr get-login-password \ | ||
--region $AWS_REGION \ | ||
| docker login \ | ||
--username AWS \ | ||
--password-stdin $ECR_REGISTRY_ENDPOINT | ||
|
||
printf "\nBuilding docker images...\n" | ||
docker build -t sourcefuse/superset-base:latest . | ||
|
||
printf "\nTagging image $IMAGE_NAME:$IMAGE_TAG...\n" | ||
docker tag sourcefuse/superset-base:latest $IMAGE_NAME:$IMAGE_TAG | ||
|
||
printf "\nPushing $IMAGE_NAME:$IMAGE_TAG to ECR...\n" | ||
docker push $IMAGE_NAME:$IMAGE_TAG | ||
|
||
echo "::set-output name=image::$IMAGE_NAME:$IMAGE_TAG" |