Skip to content

posthog upgrade (#26) #10

posthog upgrade (#26)

posthog upgrade (#26) #10

Workflow file for this run

name: Deployment
env:
CONTEXT_DIR: "./"
IMAGE_NAME: ${{ github.repository }}
DOCKERFILE: Dockerfile.caprover
CAPROVER_APP: resume
DOCKER_REGISTRY: ghcr.io
REACT_APP_GOOGLE_ANALYTICS_ID: ${{secrets.GOOGLE_TAG_ID}}
REACT_APP_POSTHOG_ID: ${{secrets.POSTHOG_ID}}
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build-and-publish:
name: Build and Push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
echo "IMAGE_NAME_WITH_REGISTRY=$DOCKER_REGISTRY/$IMAGE_NAME" >> $GITHUB_ENV
echo "REACT_APP_GOOGLE_ANALYTICS_ID=$REACT_APP_GOOGLE_ANALYTICS_ID" >> $GITHUB_ENV
echo "REACT_APP_POSTHOG_ID=$REACT_APP_POSTHOG_ID" >> $GITHUB_ENV
export IMAGE_NAME_WITH_REGISTRY=$DOCKER_REGISTRY/$IMAGE_NAME
echo "FULL_IMAGE_NAME=$IMAGE_NAME_WITH_REGISTRY:$GITHUB_SHA-gitsha" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Release to DockerHub
shell: bash
run: ./build_and_push.sh
- name: Deploy to CapRover
uses: caprover/deploy-from-github@d76580d79952f6841c453bb3ed37ef452b19752c
with:
server: ${{ secrets.CAPROVER_HOST }}
app: ${{ env.CAPROVER_APP }}
token: "${{ secrets.CAPROVER_APP_TOKEN }}"
image: "${{ env.FULL_IMAGE_NAME }}"
notify:
name: Notify
needs: [build-and-publish]
if: always()
runs-on: ubuntu-latest
steps:
- name: send telegram message on push
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
Deployment Status: ${{ job.status }}
${{ github.actor }}:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}