From 3178c8ea1937b31b831594b385111fa32d83d4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20H=C3=A4ll?= Date: Sun, 20 Oct 2024 21:01:07 +0200 Subject: [PATCH] Create create-binary.yml --- .github/workflows/create-binary.yml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/create-binary.yml diff --git a/.github/workflows/create-binary.yml b/.github/workflows/create-binary.yml new file mode 100644 index 0000000..e5cfd91 --- /dev/null +++ b/.github/workflows/create-binary.yml @@ -0,0 +1,49 @@ +name: Build binary + +on: + push: + tags: + - "v*" + +jobs: + build-api: + timeout-minutes: 10 + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set envs + run: | + echo "GITHUB_REPO=$(echo ${GITHUB_REPOSITORY})" >> $GITHUB_ENV + echo "GITHUB_REF_NAME=$(echo ${GITHUB_REF_NAME})" >> $GITHUB_ENV + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io/baffinbay + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64 + no-cache: true + file: ./build/package/Dockerfile-app + push: true + tags: | + ghcr.io/${{ env.GITHUB_REPO }}:${{ env.GITHUB_REF_NAME }} + secrets: | + "netrc=machine github.com login ${{secrets.GO_DEP_SECRETS}}"