feat: add careers page back #145
This file contains hidden or 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 and Push Docker Image to Registry | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
inputs: | |
push_image: | |
description: Push image to registry | |
required: false | |
default: true | |
type: boolean | |
env: | |
REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
IMAGE_NAME: ${{ vars.DOCKER_IMAGE_NAME }} | |
jobs: | |
build-and-push: | |
runs-on: blacksmith-8vcpu-ubuntu-2404 | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64 | |
- name: Log in to Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ vars.DOCKER_PASSWORD }} | |
- name: Extract metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
# Tag with branch name for main and dev | |
type=ref,event=branch | |
# Tag with pr number for pull requests | |
type=ref,event=pr,prefix=pr- | |
# Tag with version for releases | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
# Tag with commit SHA | |
type=sha,prefix=sha- | |
# Latest tag for main branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
labels: | | |
org.opencontainers.image.title=${{ github.repository }} | |
org.opencontainers.image.description=Zolplay website built with Next.js | |
org.opencontainers.image.vendor=Zolplay | |
org.opencontainers.image.licenses=MIT | |
- name: Build and push Docker image | |
uses: useblacksmith/build-push-action@v1 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image != 'false') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
CONTACT_WEBHOOK_URL=${{ vars.CONTACT_WEBHOOK_URL }} | |
NEXT_PUBLIC_POSTHOG_KEY=${{ vars.NEXT_PUBLIC_POSTHOG_KEY }} | |
provenance: false | |
# Trigger redeploy on dokploy => project webhooks settings | |
- name: Trigger dokploy redeploy | |
if: github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev') | |
run: | | |
if [ "${{ github.ref_name }}" = "main" ]; then | |
curl -X GET ${{ vars.DOKPLOY_WEBHOOK_MAIN }} | |
elif [ "${{ github.ref_name }}" = "dev" ]; then | |
curl -X GET ${{ vars.DOKPLOY_WEBHOOK_DEV }} | |
fi | |
- name: Generate build summary | |
run: | | |
echo "## Docker Build Summary" >> $GITHUB_STEP_SUMMARY | |
echo "- **Repository**: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY | |
echo "- **Tags**: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY | |
echo "- **Platforms**: linux/amd64" >> $GITHUB_STEP_SUMMARY | |
echo "- **Push**: ${{ github.event_name != 'pull_request' && (github.event.inputs.push_image != 'false') }}" >> $GITHUB_STEP_SUMMARY | |
echo "- **Trigger**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY | |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo "- **Latest**: ✅ This build was tagged as 'latest'" >> $GITHUB_STEP_SUMMARY | |
fi |