From 1c29d8553d3f79baa1705a4af111536fb9eddfda Mon Sep 17 00:00:00 2001 From: Igor Sereda Date: Fri, 15 Nov 2024 13:51:56 +0300 Subject: [PATCH] GH Action --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++++ Makefile | 2 +- README.md | 6 ++--- 3 files changed, 53 insertions(+), 4 deletions(-) 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..4e5e27b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build +on: + push: + branches: + - 'master' + tags: + - '*.*.*' + pull_request: + branches: + - 'master' + +jobs: + build: + name: Build + runs-on: ubuntu-latest + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + DOCKER_REGISTRY: ghcr.io + DOCKER_IMAGE_NAME: ${{ github.repository }} + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to the registry + uses: docker/login-action@v1 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Watchtower image tags & labels + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} + + - name: Watchtower image build & push + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Makefile b/Makefile index 97d5bc1..a64e635 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ py := uv run -source_dir := . +source_dir := src install: diff --git a/README.md b/README.md index f587498..74ffdf8 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Watchtower for Etherlink Bridge withdrawal operations ## Local Setup ### Prerequisites -- Install [Poetry](https://python-poetry.org/docs/#installation) if not already installed. +- Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if not already installed. ### Installation 1. Install dependencies: ```bash -poetry install +make install ``` 2. Copy and configure environment variables: @@ -30,5 +30,5 @@ docker build -t etherlink-watchtower . ### Run Docker Container ```bash -docker run -d --name watchtower --env-file .env.dist etherlink-watchtower +docker run -d --name watchtower --env-file .env etherlink-watchtower ```