superset/.github/workflows/docker.yml
Rob DiCiuccio 27f7d1157f
build: Ephemeral environments for PRs via slash command (#13189)
* First pass at ephemeral env, new Docker ci target

* Add service checks, get public IP

* Separate issue_comment and workflow_run jobs

* Refactor workflows

* Adjust comment author association

* Checkout code

* Fix image name, manage service desired task count

* Use merge commit sha

* Fix IP output, add failure comment

* Refactor comment parsing & env spinup

* Check container image publish status

* Parse AWS account ID from registry URL

* Use PR number rather than variable merge commit SHA for image tag

* Fix docker push conditional

* Push multiple tags to ECR

* Fix comment author check

* Refactor comment body check

* Provision service with active task to get correct IP

* /testenv up

* Add @mentions to PR comments, env var cleanup
2021-02-24 10:50:52 -08:00

43 lines
1.2 KiB
YAML

name: Docker
on:
push:
branches:
- 'master'
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
jobs:
docker-build:
if: github.event.pull_request.draft == false
name: docker-build
runs-on: ubuntu-latest
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
with:
persist-credentials: false
- shell: bash
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
.github/workflows/docker_build_push.sh
- name: Build ephemeral env image
if: github.event_name == 'pull_request'
run: |
mkdir -p ./build
echo ${{ github.sha }} > ./build/SHA
echo ${{ github.event.pull_request.number }} > ./build/PR-NUM
docker build --target ci -t ${{ github.sha }} -t "pr-${{ github.event.pull_request.number }}" .
docker save ${{ github.sha }} | gzip > ./build/${{ github.sha }}.tar.gz
- name: Upload build artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v2
with:
name: build
path: build/