From 8221604b4e88cdc40c9ff28b22981ae09d4a147b Mon Sep 17 00:00:00 2001 From: rupansh Date: Tue, 23 Jul 2024 21:53:51 +0530 Subject: [PATCH] feat(CI/CD): add push to ghcr.io --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 4 ++-- .github/workflows/publish-image.yml | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-image.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91d2af0..5348fb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Rust Setup uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 27c8f63..8b893a9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,9 +16,9 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download build - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-musl - run: chmod +x target/x86_64-unknown-linux-musl/release/yral-metadata-server diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml new file mode 100644 index 0000000..9f8fbbc --- /dev/null +++ b/.github/workflows/publish-image.yml @@ -0,0 +1,25 @@ +name: Deploy to ghcr.io + +on: + push: + branches: + - rupansh/grpc + workflow_dispatch: + +jobs: + docker_publish: + runs-on: "ubuntu-20.04" + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - name: Build and publish docker image + uses: macbre/push-to-ghcr@master + with: + image_name: go-bazzinga/yral-metadata + github_token: ${{ secrets.GITHUB_TOKEN }} + dockerfile: ./Dockerfile.local + image_tag: ${{ github.sha }} \ No newline at end of file