From 5079501c74b160fec6b37c16da9ec6aa11dbeb75 Mon Sep 17 00:00:00 2001 From: Xieql Date: Mon, 30 Oct 2023 11:37:49 +0800 Subject: [PATCH] workflows: add release image workflows Signed-off-by: Xieql --- .github/workflows/release-image.yaml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release-image.yaml diff --git a/.github/workflows/release-image.yaml b/.github/workflows/release-image.yaml new file mode 100644 index 000000000..7f2adf1ed --- /dev/null +++ b/.github/workflows/release-image.yaml @@ -0,0 +1,34 @@ +name: Build and Push Images + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.20.x + + - name: Compile + run: make build + + - name: Build Docker Image + # Use version tag + run: VERSION=${{ github.ref_name }} make docker + + - name: Login to ghcr.io + # This is where you will update the PAT to GITHUB_TOKEN + run: echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u $ --password-stdin + + - name: Push Docker Image + run: VERSION=${{ github.ref_name }} make docker-push +