From c60b606c4290c5ed386012dafc082870c734651f Mon Sep 17 00:00:00 2001 From: Surendra Pathak Date: Tue, 4 Jul 2023 23:45:52 -0700 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fbf3f3a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build and Push to GHCR +on: + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get Tag + id: get_tag + run: echo "tag=$(git describe --tags HEAD)" > $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: GHCR login + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository }}:${{ env.tag }}