From 6b02a1a610e8bd626ad3cfc62ce192dc540da776 Mon Sep 17 00:00:00 2001 From: Amitabh Anand Date: Fri, 6 Sep 2024 11:15:53 +0530 Subject: [PATCH] deploy gh action --- .github/workflows/docker-build.yml | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..570c92b --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,44 @@ +name: PFL Build and Push Docker Image to GHCR + +on: + push: + +jobs: + build-and-push: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/fastlane-labs/bdn-operations-relay + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + latest-{{branch}} + sha-{{sha}} + + - name: Authenticate to Github registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }}