Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
PUBLISH: ${{ github.repository == 'mcruzdev/timeless' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}

jobs:
timeless-api:
name: Build & Publish - Timeless API (Java)
Expand Down Expand Up @@ -60,23 +63,23 @@ jobs:

- name: Set up Podman
uses: gacts/install-podman@v1
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
id: podman

- name: Login to Quay.io
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Create Docker image
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
run: docker build -f src/main/docker/Dockerfile.jvm -t quay.io/timeless/timeless-api:${GITHUB_SHA::7} .

- name: Push Docker image to Quay.io
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
run: docker push quay.io/timeless/timeless-api:${GITHUB_SHA::7}

whatsapp:
Expand Down Expand Up @@ -104,17 +107,17 @@ jobs:
run: npm run prettier:check

- name: Login to Quay.io
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Create Docker image
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
run: docker build -f Dockerfile -t quay.io/timeless/whatsapp:${GITHUB_SHA::7} .

- name: Push Docker image to Quay.io
if: github.repository == 'mcruzdev/timeless'
if: env.PUBLISH == 'true'
run: docker push quay.io/timeless/whatsapp:${GITHUB_SHA::7}