footer updated #88
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deployment | |
on: | |
push: | |
branches: [ master, next ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ github.ref_name }} | |
steps: | |
# Checkout the repo | |
- uses: actions/checkout@v2 | |
# Setup Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Build and push Docker Image | |
- name: Login to Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GH_TOKEN }} | |
- name: Preset Image Name | |
run: echo "IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ env.IMAGE_URL }} | |
build-args: | | |
NEXT_PUBLIC_POSTHOG_KEY=${{ vars.NEXT_PUBLIC_POSTHOG_KEY }} | |
NEXT_PUBLIC_POSTHOG_HOST=${{ vars.NEXT_PUBLIC_POSTHOG_HOST }} | |
NEXT_PUBLIC_SENTRY_DSN=${{ vars.NEXT_PUBLIC_SENTRY_DSN }} | |
SENTRY_DSN=${{ vars.SENTRY_DSN }} | |
# Deploy to CapRover | |
- name: Deploy Image to CapRover | |
uses: caprover/deploy-from-github@v1.1.2 | |
with: | |
server: "${{ vars.CAPROVER_SERVER }}" | |
app: "${{ vars.APP_NAME }}" | |
token: "${{ secrets.APP_TOKEN }}" | |
image: ${{ env.IMAGE_URL }} |