Skip to content

Publish and deploy #311

Publish and deploy

Publish and deploy #311

Workflow file for this run

name: Publish and deploy
on: create
env:
SERVICE_NAME: ${{ github.event.repository.name }}
GOOGLE_PROJECT: broad-dsp-gcr-public
jobs:
publish-job:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Parse tag
id: tag
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
- name: Publish to Artifactory
run: ./gradlew --build-cache :client:artifactoryPublish
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
ARTIFACTORY_REPO_KEY: "libs-release-local"
- id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCR_PUBLISH_KEY_B64 }}
- name: setup gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Explicitly auth Docker for GCR
run: gcloud auth configure-docker --quiet
- name: Construct docker image name and tag
id: image-name
run: echo "name=gcr.io/${GOOGLE_PROJECT}/${SERVICE_NAME}:${{ steps.tag.outputs.tag }}" >> $GITHUB_OUTPUT
- name: Build image locally with jib
run: |
./gradlew --build-cache :service:jibDockerBuild \
--image=${{ steps.image-name.outputs.name }} \
-Djib.console=plain
- name: Push GCR image
run: docker push ${{ steps.image-name.outputs.name }}
- name: Deploy to Terra Dev environment
uses: broadinstitute/repository-dispatch@master
with:
token: ${{ secrets.BROADBOT_TOKEN }}
repository: broadinstitute/terra-helmfile
event-type: update-service
client-payload: '{"service": "catalog", "version": "${{ steps.tag.outputs.tag }}", "dev_only": false}'
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#dsp-data-exploration'
status: failure
author_name: Publish to dev
fields: job
text: 'Publish failed :sadpanda:'
username: 'Data Explorer GitHub Action'