From 506d3b6e10b3bbe62436ea6d0b5288a0419cb7b2 Mon Sep 17 00:00:00 2001 From: "mark.cherepovskyi" Date: Mon, 14 Aug 2023 10:59:28 +0300 Subject: [PATCH] add ci --- .github/workflows/actions.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/tag.yml | 33 +++++++++++++++++++++++++++++++++ werf-giterminism.yaml | 5 +++++ werf.yaml | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 .github/workflows/actions.yml create mode 100644 .github/workflows/tag.yml create mode 100644 werf-giterminism.yaml create mode 100644 werf.yaml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..7a7988a --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,33 @@ +on: + push: + branches: + - '**' + +jobs: + converge: + name: Converge + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install werf + uses: werf/actions/install@v1.2 + + - name: Log in to registry + # This is where you will update the personal access token to GITHUB_TOKEN + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Run echo + run: | + werf version + docker version + echo $GITHUB_REPOSITORY + echo $GITHUB_SHA + - name: Run Build + run: | + . $(werf ci-env github --as-file) + werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..676c1ca --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,33 @@ +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + converge: + name: Converge + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install werf + uses: werf/actions/install@v1.2 + + - name: Log in to registry + # This is where you will update the personal access token to GITHUB_TOKEN + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Run echo + run: | + werf version + docker version + echo $GITHUB_REPOSITORY + echo $GITHUB_REF_NAME + - name: Run Build + run: | + . $(werf ci-env github --as-file) + werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME \ No newline at end of file diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml new file mode 100644 index 0000000..4015882 --- /dev/null +++ b/werf-giterminism.yaml @@ -0,0 +1,5 @@ +giterminismConfigVersion: 1 +config: + goTemplateRendering: + allowEnvVariables: ["CI_JOB_TOKEN"] + diff --git a/werf.yaml b/werf.yaml new file mode 100644 index 0000000..7a7988a --- /dev/null +++ b/werf.yaml @@ -0,0 +1,33 @@ +on: + push: + branches: + - '**' + +jobs: + converge: + name: Converge + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install werf + uses: werf/actions/install@v1.2 + + - name: Log in to registry + # This is where you will update the personal access token to GITHUB_TOKEN + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Run echo + run: | + werf version + docker version + echo $GITHUB_REPOSITORY + echo $GITHUB_SHA + - name: Run Build + run: | + . $(werf ci-env github --as-file) + werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA \ No newline at end of file