From 22e6da0349aa30806c5402792a0db6c23e79df62 Mon Sep 17 00:00:00 2001 From: bagas Date: Mon, 4 Aug 2025 22:33:06 +0700 Subject: [PATCH] add ci/cd --- .gitea/workflows/build.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..6cf6047 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,45 @@ +name: Docker Build and Push + +on: + push: + branches: + - main + - staging + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: git.fossy.my.id + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image for main + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/porto:latest + platforms: linux/amd64,linux/arm64 + if: github.ref == 'refs/heads/main' + + - name: Build and push Docker image for staging + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/porto:staging + platforms: linux/amd64,linux/arm64 + if: github.ref == 'refs/heads/staging' \ No newline at end of file