From 3ffc4aa368f9ef1afd50b59aa4aeb283b56bfbe8 Mon Sep 17 00:00:00 2001 From: Blade <99137075+nodiesBlade@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:01:35 -0500 Subject: [PATCH] Create build-images.yml ci cd --- .github/workflows/build-images.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build-images.yml diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml new file mode 100644 index 0000000..ec935d3 --- /dev/null +++ b/.github/workflows/build-images.yml @@ -0,0 +1,53 @@ +# This workflow only handles build & push of images to GitHub Container Registry. +# We have other pipepines in CircleCI, such as tests, that are not migrated to GitHub Actions. + +name: Build container and push images + +on: + workflow_dispatch: + push: + branches: [main] + tags: ['*'] + pull_request: + branches: [main] + +jobs: + build-images: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Docker Setup QEMU + uses: docker/setup-qemu-action@v2 + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v2 + - name: Docker Metadata action + id: meta + uses: docker/metadata-action@v4 + env: + DOCKER_METADATA_PR_HEAD_SHA: "true" + with: + images: | + ghcr.io/pokt-network/pocket-gateway-server + tags: | + type=schedule + type=ref,event=tag + type=ref,event=branch + type=ref,event=pr + type=sha + type=sha,format=long + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + file: Dockerfile + cache-from: type=gha + cache-to: type=gha,mode=max