From bd55399c1b2852a9738e4868685d172e04cbf6d6 Mon Sep 17 00:00:00 2001 From: Masih Tanoursaz Date: Tue, 8 Sep 2026 15:42:59 -0400 Subject: [PATCH] ci: add Docker image publishing workflow --- .github/workflows/docker-publish.yml | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..4ec53cd --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,70 @@ +name: Docker Publish Test + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + publish: + name: Build and Push Images + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push web image + uses: docker/build-push-action@v7 + with: + context: ./apps/web + target: runner + push: true + build-args: | + NEXT_PUBLIC_BUSINESS_ADDRESS=77 Finch Avenue East, Toronto, Ontario + NEXT_PUBLIC_INSTAGRAM_URL=https://www.instagram.com/nail_toronto_manisa/ + tags: | + ${{ vars.DOCKERHUB_USERNAME }}/manisa-web:${{ github.sha }} + ${{ vars.DOCKERHUB_USERNAME }}/manisa-web:latest + cache-from: type=gha,scope=manisa-web + cache-to: type=gha,mode=max,scope=manisa-web + provenance: true + sbom: true + + - name: Build and push database migration image + uses: docker/build-push-action@v7 + with: + context: ./apps/web + target: database + push: true + tags: | + ${{ vars.DOCKERHUB_USERNAME }}/manisa-database:${{ github.sha }} + ${{ vars.DOCKERHUB_USERNAME }}/manisa-database:latest + cache-from: type=gha,scope=manisa-database + cache-to: type=gha,mode=max,scope=manisa-database + provenance: true + sbom: true + + - name: Build and push worker image + uses: docker/build-push-action@v7 + with: + context: ./apps/web + target: media-worker + push: true + tags: | + ${{ vars.DOCKERHUB_USERNAME }}/manisa-worker:${{ github.sha }} + ${{ vars.DOCKERHUB_USERNAME }}/manisa-worker:latest + cache-from: type=gha,scope=manisa-worker + cache-to: type=gha,mode=max,scope=manisa-worker + provenance: true + sbom: true \ No newline at end of file