From 803fe7147eaf7bbb09aa5af567e032d44dc20527 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Fri, 20 Dec 2024 22:24:54 -0600 Subject: [PATCH] Set up github workflow to build and push images --- .github/workflows/build-and-push-images.yml | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-and-push-images.yml diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml new file mode 100644 index 0000000..8fe3f08 --- /dev/null +++ b/.github/workflows/build-and-push-images.yml @@ -0,0 +1,48 @@ +name: Docker Image CI + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: investbrainapp + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: investbrainapp + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract version from tag + id: extract-version + run: | + echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: | + investbrainapp/investbrain:latest + investbrainapp/investbrain:${{ env.version }} + ghcr.io/investbrainapp/investbrain:latest + ghcr.io/investbrainapp/investbrain:${{ env.version }} + +