From b9e192333965fb5b04a5eff4d2d374965a857add Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Fri, 11 Oct 2024 10:35:37 -0400 Subject: [PATCH 1/3] build docker image --- .github/workflows/k8s.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/k8s.yml diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml new file mode 100644 index 0000000..e2268dd --- /dev/null +++ b/.github/workflows/k8s.yml @@ -0,0 +1,33 @@ +name: Kubernetes + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + PYTHON_VERSION: 3.9 + TPCH_SCALING_FACTOR: "1" + TPCH_TEST_PARTITIONS: "1" + TPCH_DATA_PATH: "data" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: username/repository:tag From 0086112ef9534f9441ea853a6b822744fa5aa4be Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Fri, 11 Oct 2024 11:33:51 -0400 Subject: [PATCH 2/3] Fixing right dockerfile version --- .github/workflows/k8s.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index e2268dd..b33a832 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -26,8 +26,8 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: context: . - push: true + file: ./k8s/Dockerfile tags: username/repository:tag From 434e7b207108772a2c92f8c7104bea9bbd29128a Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Sat, 12 Oct 2024 17:35:01 -0400 Subject: [PATCH 3/3] Publishing only on tags --- .github/workflows/k8s.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index b33a832..be1f838 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -4,30 +4,29 @@ on: push: pull_request: -env: - CARGO_TERM_COLOR: always - PYTHON_VERSION: 3.9 - TPCH_SCALING_FACTOR: "1" - TPCH_TEST_PARTITIONS: "1" - TPCH_DATA_PATH: "data" - jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHON_VERSION }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry + if: startsWith(github.ref, 'refs/tags/') + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image uses: docker/build-push-action@v6 with: context: . file: ./k8s/Dockerfile tags: username/repository:tag + # Push only on tags + push: ${{ startsWith(github.ref, 'refs/tags/') }}