From e85f6e3cb529a734d999b5a071cda3ccf2eeabd5 Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 20 Jul 2024 14:10:04 -0700 Subject: [PATCH] Build arch specific images --- .github/workflows/CD.yml | 38 ++++++++++++++++++++++++++++++++++++++ .yamllint | 8 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/CD.yml create mode 100644 .yamllint diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..5f79107 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,38 @@ +# This workflow will upload a docker image +# to https://hub.docker.com/repository/docker/twindb/omnibus-ubuntu +--- +name: Continuous Deployment + +on: # yamllint disable-line rule:truthy + push: + branches: ["focal"] +jobs: + push_to_registry: + name: "Push Docker image to Docker Hub" + runs-on: ${{matrix.os}} + strategy: + matrix: + os: ["ubuntu-latest"] + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + # Credit https://stackoverflow.com/a/58035262 + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + + - name: "Log in to Docker Hub" + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: "Build and push the image" + run: | + ARCH=$(uname -m) + docker build -t twindb/omnibus-ubuntu:${{ steps.extract_branch.outputs.branch }}-${ARCH} . + docker build -t twindb/omnibus-ubuntu:${{ steps.extract_branch.outputs.branch }} . + docker push twindb/omnibus-ubuntu:${{ steps.extract_branch.outputs.branch }}-${ARCH} + docker push twindb/omnibus-ubuntu:${{ steps.extract_branch.outputs.branch }} diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..3a7ea3d --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + line-length: + max: 120 + level: warning +...