name: Build and Push Quartz Wiki on: push: branches: - v4 env: REGISTRY: "gitea.vorpax.dev" IMAGE_NAME: "vorpax/wiki" jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Gitea Container Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Extract metadata (tags, labels) id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=branch type=sha,prefix= type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', 'v4') }} - name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile.prod push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest run: echo "Image built and pushed successfully" #- name: Trigger Komodo Webhook # run: ../scripts/komodo-webhook.sh # Optional: Add deployment step # Uncomment and configure this section if you want automatic deployment # deploy: # runs-on: ubuntu-latest # needs: build-and-push # steps: # - name: Deploy to server # uses: appleboy/ssh-action@v1.0.0 # with: # host: ${{ secrets.DEPLOY_HOST }} # username: ${{ secrets.DEPLOY_USER }} # key: ${{ secrets.DEPLOY_SSH_KEY }} # script: | # cd /path/to/quartz # docker compose pull # docker compose up -d