Release on Dockerhub #19
Workflow file for this run
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: Release on Dockerhub | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release-image-on-dockerhub: | |
name: Release on Dockerhub | |
runs-on: ubuntu-latest | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/formbricks?schema=public" | |
steps: | |
- name: Generate Random NEXTAUTH_SECRET | |
run: | | |
SECRET=$(openssl rand -hex 32) | |
echo "NEXTAUTH_SECRET=$SECRET" >> $GITHUB_ENV | |
- name: Generate Random ENCRYPTION_KEY | |
run: | | |
SECRET=$(openssl rand -hex 32) | |
echo "ENCRYPTION_KEY=$SECRET" >> $GITHUB_ENV | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Get Release Tag | |
id: extract_release_tag | |
run: | | |
TAG=${{ github.ref }} | |
TAG=${TAG#refs/tags/v} | |
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./apps/web/Dockerfile | |
push: true | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/formbricks:${{ env.RELEASE_TAG }} | |
${{ secrets.DOCKER_USERNAME }}/formbricks:latest | |
build-args: | | |
NEXTAUTH_SECRET=${{ env.NEXTAUTH_SECRET }} | |
DATABASE_URL=${{ env.DATABASE_URL }} | |
ENCRYPTION_KEY=${{ env.ENCRYPTION_KEY }} |