diff --git a/.github/workflows/mkdocs-latest.yaml b/.github/workflows/mkdocs-latest.yaml index fe38ba4f0cc..fe59b7a1bb6 100644 --- a/.github/workflows/mkdocs-latest.yaml +++ b/.github/workflows/mkdocs-latest.yaml @@ -3,10 +3,11 @@ # name: Deploy the latest documentation on: - push: - tags: - - "v*" - workflow_dispatch: {} + workflow_dispatch: + inputs: + ref: + description: The tag to be released, e.g. v0.0.1 + required: true jobs: deploy: name: Deploy the latest documentation @@ -15,6 +16,7 @@ jobs: - name: Checkout main uses: actions/checkout@v3 with: + ref: ${{ github.event.inputs.ref }} fetch-depth: 0 persist-credentials: true - name: Login to docker.io registry @@ -38,8 +40,5 @@ jobs: git config user.email "github-actions@github.com" - name: Deploy the latest documents run: | - VERSION="${{ github.event.inputs.tag }}" - if [ -z $VERSION ]; then - VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") - fi + VERSION="${{ github.event.inputs.ref }}" mike deploy --push --update-aliases ${VERSION%.*} latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 40dceb2e0cd..d4b9e9ccbf9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,9 +3,11 @@ # name: Release on: - push: - tags: - - "v*" + workflow_dispatch: + inputs: + ref: + description: The tag to be released, e.g. v0.0.1 + required: true jobs: release: name: Release X64 (Default) @@ -23,6 +25,7 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 with: + ref: ${{ github.event.inputs.ref }} submodules: true fetch-depth: 0 - name: Install Cosign @@ -45,7 +48,7 @@ jobs: # use :x86_64-v0.xx.0 for versioned image - name: Publish to docker.io registry run: | - TAG=$(git describe --tags --abbrev=0 | sed -e "s/v//gI") + TAG=$(echo ${{ github.event.inputs.ref }} | sed -e "s/v//gI") ARCH=$(uname -m) docker image tag tracee:latest aquasec/tracee:latest docker image tag tracee:latest aquasec/tracee:${ARCH} @@ -57,7 +60,7 @@ jobs: docker image push aquasec/tracee:${ARCH}-${TAG} - name: Sign Docker image run: | - TAG=$(git describe --tags --abbrev=0 | sed -e "s/v//gI") + TAG=$(echo ${{ github.event.inputs.ref }} | sed -e "s/v//gI") ARCH=$(uname -m) cosign sign -y $(docker inspect --format='{{index .RepoDigests 0}}' aquasec/tracee:latest) cosign sign -y $(docker inspect --format='{{index .RepoDigests 0}}' aquasec/tracee:${ARCH}) @@ -82,6 +85,7 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 with: + ref: ${{ github.event.inputs.ref }} submodules: true fetch-depth: 0 - name: Install Cosign @@ -104,7 +108,7 @@ jobs: # use :aarch64-v0.xx.0 for versioned image - name: Publish to docker.io registry run: | - TAG=$(git describe --tags --abbrev=0 | sed -e "s/v//gI") + TAG=$(echo ${{ github.event.inputs.ref }} | sed -e "s/v//gI") ARCH=$(uname -m) docker image tag tracee:latest aquasec/tracee:${ARCH} docker image tag tracee:latest aquasec/tracee:${ARCH}-${TAG} @@ -112,7 +116,7 @@ jobs: docker image push aquasec/tracee:${ARCH}-${TAG} - name: Sign Docker image run: | - TAG=$(git describe --tags --abbrev=0 | sed -e "s/v//gI") + TAG=$(echo ${{ github.event.inputs.ref }} | sed -e "s/v//gI") ARCH=$(uname -m) cosign sign -y $(docker inspect --format='{{index .RepoDigests 0}}' aquasec/tracee:${ARCH}) cosign sign -y $(docker inspect --format='{{index .RepoDigests 0}}' aquasec/tracee:${ARCH}-${TAG})