From f8dddc150a8c6c7e1328d95ebf8e5c0091aaeb3e Mon Sep 17 00:00:00 2001 From: zero88 Date: Mon, 5 Apr 2021 10:01:17 +0700 Subject: [PATCH] Monorepo https://github.com/crazy-max/ghaction-docker-meta/issues/56 --- .editorconfig | 12 ++++++++ .github/workflows/docker.yml | 7 +---- .github/workflows/p1.yml | 55 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- p1/version.py | 1 + 5 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/p1.yml create mode 100644 p1/version.py diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ee55245 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 + +[*.{json, yml, yaml, md, js, ts}] +indent_size = 2 + +[*.{bat, ps1}] +end_of_line = crlf diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2593ff4..2fbafcf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,15 +1,10 @@ -name: docker +name: docker-cache on: # push: # branches: # - main workflow_dispatch: - inputs: - type: - description: 'Type' - required: true - default: javascript jobs: hello_world_job: diff --git a/.github/workflows/p1.yml b/.github/workflows/p1.yml new file mode 100644 index 0000000..2cc632c --- /dev/null +++ b/.github/workflows/p1.yml @@ -0,0 +1,55 @@ +name: build-vpnclient + +on: + pull_request: + types: [ opened, synchronize, reopened, closed ] + branches: [ main, master ] + paths: + - '.github/workflows/p1.yml' + - 'p1/**' + push: + branches: [ main, master ] + tags: + - 'p1/v*' + paths: + - '.github/workflows/p1.yml' + - 'p1/**' + +jobs: + + context: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.OSS_GITHUB_TOKEN }} + + - name: Project context + id: context + uses: zero88/gh-project-context@v1 + with: + dry: false + defaultBranch: master + tagPrefix: p1/v + releaseBranchPrefix: release/p1/ + mergedReleaseMsgRegex: "^Merge pull request #[0-9]+ from .+/release/p1/.+$" + patterns: | + p1/version.py::(VERSION\s?=\s?)(')([^']+)(')::2 + + - name: Docker context + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v2 + with: + images: ${{ env.APP_IMAGE }} + tags: | + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=sha + type=match,pattern=p1\/v(.*),group=1 + + - name: Print + run: | + echo "${{ steps.docker_meta.outputs.tags }}" + echo "${{ steps.docker_meta.outputs.labels }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index caf11a6..daf5813 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: First run +name: GH-context on: push: diff --git a/p1/version.py b/p1/version.py new file mode 100644 index 0000000..1e5a605 --- /dev/null +++ b/p1/version.py @@ -0,0 +1 @@ +VERSION = '1.0.0'