From d55e06173b3a35de6c0b586fd9aee0216e9455da Mon Sep 17 00:00:00 2001 From: Dreu LaVelle Date: Fri, 26 Jul 2024 02:43:01 -0500 Subject: [PATCH] feat: add automatic dev builds in pipeline --- .github/workflows/docker-build-dev.yml | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/docker-build-dev.yml diff --git a/.github/workflows/docker-build-dev.yml b/.github/workflows/docker-build-dev.yml new file mode 100644 index 00000000..6631e800 --- /dev/null +++ b/.github/workflows/docker-build-dev.yml @@ -0,0 +1,67 @@ +name: Docker Build and Push Dev + +on: + push: + branches: + - main + +jobs: + build-and-push-dev: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + security-events: write + + steps: + - name: Checkout code + uses: actions/checkout@v4.1.2 + + - name: Docker Setup QEMU + uses: docker/setup-qemu-action@v3 + id: qemu + with: + platforms: amd64,arm64 + + - name: Log into ghcr.io registry + uses: docker/login-action@v3.1.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.2.0 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.1.0 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build Docker Metadata + id: docker-metadata + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/rivenmedia/riven + docker.io/spoked/riven + flavor: | + latest=auto + tags: | + type=ref,event=branch + type=sha,commit=${{ github.sha }} + type=raw,value=dev,enable={{is_default_branch}} + + - name: Push Dev Image to repo + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + provenance: mode=max + tags: ${{ steps.docker-metadata.outputs.tags }} + labels: ${{ steps.docker-metadata.outputs.labels }} + platforms: linux/amd64,linux/arm64 + cache-from: type=gha,scope=${{ github.workflow }} + cache-to: type=gha,mode=max,scope=${{ github.workflow }}