Skip to content

Remove branch extraction- use ref_name #33

Remove branch extraction- use ref_name

Remove branch extraction- use ref_name #33

Workflow file for this run

name: Deploy Superset to Beta
on:
push:
branches:
- beta-*
jobs:
Deploy-Beta-Superset:
runs-on: ubuntu-latest
steps:
- name: Ensure python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Checkout code
uses: actions/checkout@v3
- name: Acquire list of changed events files
id: all-events-files
continue-on-error: true
uses: tj-actions/changed-files@v38
with:
files: |
plaid/event_handler.py
plaid/requirements.txt
Dockerfile.events
- name: Create tag
id: docker_tag
run: |
commit_tag=${GITHUB_REF#refs/*/}
echo "tag=${commit_tag}-${{ github.run_number }}" >> $GITHUB_OUTPUT
- name: Verify tag
run: echo ${{ steps.docker_tag.outputs.tag }}
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
- name: Build superset and push
if: steps.all-events-files.outputs.only_changed == 'false'
# docker build -t gcr.io/plaidcloud-build/auth-service:latest --pull --build-arg PLAID_BUILD_TAG={tag} --no-cache .
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
pull: true
no-cache: true
build-args: |
PLAID_BUILD_TAG:${{ steps.docker_tag.outputs.tag }}
tags: gcr.io/plaidcloud-build/superset:latest,gcr.io/plaidcloud-build/superset:${{ github.ref_name }}-${{ github.run_number }}
- name: Build events and push
if: steps.all-events-files.outputs.any_changed == 'true'
id: docker_events_build
uses: docker/build-push-action@v3
with:
push: true
pull: true
no-cache: true
build-args: |
PLAID_BUILD_TAG:${{ steps.docker_tag.outputs.tag }}
file: Dockerfile.events
tags: gcr.io/plaidcloud-build/superset-events:latest,gcr.io/plaidcloud-build/superset-events:${{ github.ref_name }}-${{ github.run_number }}
- name: Deploy to Argo
if: steps.all-events-files.outputs.only_changed == 'false'
uses: clowdhaus/argo-cd-action/@main
env:
ARGOCD_SERVER: deploy.plaidcloud.io
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This might not be needed - Mostly used to avoid rate limiting
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}
with:
command: app
options: set beta-superset -p image.tag=${{ github.ref_name }}-${{ github.run_number }}
- name: Deploy Events to Argo
if: steps.all-events-files.outputs.any_changed == 'true'
uses: clowdhaus/argo-cd-action/@main
env:
ARGOCD_SERVER: deploy.plaidcloud.io
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This might not be needed - Mostly used to avoid rate limiting
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}
with:
command: app
options: set beta-superset-events -p image.tag=${{ github.ref_name }}-${{ github.run_number }}
- name: Set Events Repo for Superset
if: steps.all-events-files.outputs.any_changed == 'true'
uses: clowdhaus/argo-cd-action/@main
env:
ARGOCD_SERVER: deploy.plaidcloud.io
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This might not be needed - Mostly used to avoid rate limiting
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}
with:
command: app
options: set beta-superset -p events.repository=gcr.io/plaidcloud-build/superset-events:${{ github.ref_name }}-${{ github.run_number }}