-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into danielgaspar/fix/import-validation
- Loading branch information
Showing
3 changed files
with
34 additions
and
75 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
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
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 |
---|---|---|
|
@@ -79,55 +79,51 @@ jobs: | |
}) | ||
core.setFailed(errMsg) | ||
docker_ephemeral_env: | ||
needs: config | ||
if: needs.config.outputs.has-secrets | ||
name: Push ephemeral env Docker image to ECR | ||
ephemeral-docker-build: | ||
needs: ephemeral_env_comment | ||
name: docker-build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Download artifact" | ||
uses: actions/[email protected] | ||
- name: Get Info from comment | ||
uses: actions/github-script@v3 | ||
id: get-pr-info | ||
with: | ||
script: | | ||
const artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
const request = { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{ github.event.workflow_run.id }}, | ||
}); | ||
core.info('*** artifacts') | ||
core.info(JSON.stringify(artifacts)) | ||
const matchArtifact = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name === "build"; | ||
}); | ||
if (!matchArtifact.length) { | ||
return core.setFailed("Build artifacts not found"); | ||
pull_number: ${{ github.event.issue.number }}, | ||
} | ||
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`) | ||
const pr = await github.pulls.get(request); | ||
return pr.data; | ||
const download = await github.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact[0].id, | ||
archive_format: 'zip', | ||
}); | ||
var fs = require('fs'); | ||
fs.writeFileSync('${{github.workspace}}/build.zip', Buffer.from(download.data)); | ||
- name: Debug | ||
id: get-sha | ||
run: | | ||
echo "sha=${{ fromJSON(steps.get-pr-info.outputs.result).head.sha }}" >> $GITHUB_OUTPUT | ||
- run: unzip build.zip | ||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} : ${{steps.get-sha.outputs.sha}} )" | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.get-sha.outputs.sha }} | ||
persist-credentials: false | ||
|
||
- name: Display downloaded files (debug) | ||
run: ls -la | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Get SHA | ||
id: get-sha | ||
run: echo "::set-output name=sha::$(cat ./SHA)" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Get PR | ||
id: get-pr | ||
run: echo "::set-output name=num::$(cat ./PR-NUM)" | ||
- name: Build ephemeral env image | ||
run: | | ||
docker buildx build --target ci \ | ||
--load \ | ||
-t ${{ steps.get-sha.outputs.sha }} \ | ||
-t "pr-${{ github.event.issue.number }}" \ | ||
--platform linux/amd64 \ | ||
--label "build_actor=${GITHUB_ACTOR}" \ | ||
. | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -146,9 +142,8 @@ jobs: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: superset-ci | ||
SHA: ${{ steps.get-sha.outputs.sha }} | ||
IMAGE_TAG: pr-${{ steps.get-pr.outputs.num }} | ||
IMAGE_TAG: pr-${{ github.event.issue.number }} | ||
run: | | ||
docker load < $SHA.tar.gz | ||
docker tag $SHA $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker tag $SHA $ECR_REGISTRY/$ECR_REPOSITORY:$SHA | ||
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY | ||
|