From 4f9ea1022fd263504ba15dcaaa976dc78a82d107 Mon Sep 17 00:00:00 2001 From: Stanislav Dzisiak Date: Wed, 4 Sep 2024 17:25:58 +0300 Subject: [PATCH] create build workflow --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++++++++ eslint/test | 1 + 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 eslint/test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6b4627e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: build + +on: + push: + branches: + # - main + - create-workflow + +env: + DOCKER_BUILD_RECORD_UPLOAD: false + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + directories: ${{ steps.set_directories.outputs.directories }} + + steps: + - uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + multi-language: + - 'multi-language/**' + checkstyle: + - 'checkstyle/**' + sqlint: + - 'sqlint/**' + phpcs: + - 'phpcs/**' + layout-designer-lint: + - 'layout-designer-lint/**' + python-flake8: + - 'python-flake8/**' + golangci-lint: + - 'golangci-lint/**' + rubocop: + - 'rubocop/**' + eslint: + - 'eslint/**' + nulllint: + - 'nulllint/**' + + - id: set_directories + run: echo "directories=${{ toJson(steps.changes.outputs.changes) }}" >> "$GITHUB_OUTPUT" + + build: + needs: prepare + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + directory: ${{ fromJson(needs.prepare.outputs.directories) }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to YC Registry + uses: docker/login-action@v3 + with: + registry: cr.yandex + username: ${{ secrets.YCR_USERNAME }} + password: ${{ secrets.YCR_PASSWORD }} + + - name: Build and Push + uses: docker/build-push-action@v6 + with: + context: ${{ matrix.directory }} + push: true + tags: cr.yandex/${{ secrets.YCR_ID }}/common-${{ matrix.directory }}:latest diff --git a/eslint/test b/eslint/test new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/eslint/test @@ -0,0 +1 @@ +1