Skip to content

feat: RT #31496 google analytics (#55) #691

feat: RT #31496 google analytics (#55)

feat: RT #31496 google analytics (#55) #691

Workflow file for this run

name: TACC Docs Build
on:
workflow_dispatch:
inputs:
runs_on:
description: 'On which operating system to run the build'
required: false
default: 'ubuntu-latest' # default for manual run
type: choice
options:
- ubuntu-latest
- macos-latest
push:
branches:
- main
jobs:
docker:
# default for automatic run on 'push'
runs-on: ${{ github.event_name == 'push' && 'ubuntu-latest' || inputs.runs_on }}
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Checkout repo
uses: actions/checkout@v3
-
name: Get shortsha and branch name
id: vars
run: |
if [ -z "$EVENT_SHA" ]; then SHORT_SHA=${GITHUB_SHA::8}; else SHORT_SHA=${EVENT_SHA::8}; fi
echo ::set-output name=sha_short::${SHORT_SHA}
SHORT_REF=`git describe --exact-match --tags 2>/dev/null || git symbolic-ref --short HEAD | sed 's/[^[:alnum:]\.\_\-]/-/g'`
echo ::set-output name=ref_short::${SHORT_REF}
env:
EVENT_SHA: ${{ github.event.client_payload.sha }}
- name: Print vars
run: |
echo $SHORT_SHA
echo $SHORT_REF
env:
SHORT_SHA: ${{ steps.vars.outputs.sha_short }}
SHORT_REF: ${{ steps.vars.outputs.ref_short }}
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: taccwma/tacc-docs:latest,taccwma/tacc-docs:${{ steps.vars.outputs.sha_short }},taccwma/tacc-docs:${{ steps.vars.outputs.ref_short }}
-
name: Post build status in slack
id: slack
uses: slackapi/slack-github-action@v1.23.0
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"build_status": "${{ job.status }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}