diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index b2cf6d2f..9cbdd32d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,4 +1,4 @@ -name: release +name: Release new docs env: ARGO_NAMESPACE: argo ARGO_VERSION: v3.4.1 @@ -8,10 +8,12 @@ on: branches: - main workflow_dispatch: + jobs: - publish: + chart: runs-on: self-hosted steps: + - name: Setup Runner for Argo run: | cd $HOME @@ -25,30 +27,36 @@ jobs: # Move binary to path sudo mv ./argo-linux-amd64 /usr/local/bin/argo # Test installation + argo version --short + - name: Check out repository code uses: actions/checkout@v3 + - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - run: echo ${GITHUB_REPOSITORY} - run: echo ${GITHUB_REPOSITORY_NAME_PART} - run: echo ${GITHUB_SERVER_URL} - - name: publish + - run: echo ${GITHUB_RUN_ATTEMPT} + + - name: Publish a new chart version of the docs run: | echo "commit sha ${GITHUB_SHA}" argo version --short argo submit .argo/publish.yaml \ - --generate-name="${GITHUB_REPOSITORY_NAME_PART}-publish-${GITHUB_SHA_SHORT}-" \ + --generate-name="${GITHUB_REPOSITORY_NAME_PART}-publish-${GITHUB_SHA_SHORT}-${GITHUB_RUN_ATTEMPT}-" \ -p appName="${GITHUB_REPOSITORY_NAME_PART}" \ -p branch="${GITHUB_REF_NAME}" \ -p containerRegistryURL="${CONTAINER_REGISTRY_URL}/${GITHUB_REPOSITORY_NAME_PART}:${GITHUB_SHA_SHORT}" \ -p gitUrlNoProtocol="git@github.com:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \ -p shortSha="${GITHUB_SHA_SHORT}" \ --wait --log - - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst" + development: - needs: publish + needs: chart runs-on: self-hosted steps: + - name: Setup Runner for Argo run: | cd $HOME @@ -63,16 +71,19 @@ jobs: sudo mv ./argo-linux-amd64 /usr/local/bin/argo # Test installation argo version --short + - name: Check out repository code uses: actions/checkout@v3 + - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - - name: development + + - name: Deploy docs on development run: | echo "commit sha $GITHUB_SHA" argo version --short argo submit .argo/deploy.yaml \ - --generate-name="${GITHUB_REPOSITORY_NAME_PART}-development-${GITHUB_SHA_SHORT}-" \ + --generate-name="${GITHUB_REPOSITORY_NAME_PART}-development-${GITHUB_SHA_SHORT}-${GITHUB_RUN_ATTEMPT}-" \ -p appName="${GITHUB_REPOSITORY_NAME_PART}" \ -p branch="${GITHUB_REF_NAME}" \ -p clusterName="mgmt-20-kubefirst-com" \ @@ -80,11 +91,12 @@ jobs: -p gitUrlNoProtocol="git@github.com:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \ -p shortSha="${GITHUB_SHA_SHORT}" \ --wait --log - - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst" + staging: needs: development runs-on: self-hosted steps: + - name: Setup Runner for Argo run: | cd $HOME @@ -99,16 +111,19 @@ jobs: sudo mv ./argo-linux-amd64 /usr/local/bin/argo # Test installation argo version --short + - name: Check out repository code uses: actions/checkout@v3 + - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - - name: staging + + - name: Deploy docs on staging run: | echo "commit sha $GITHUB_SHA" argo version --short argo submit .argo/deploy.yaml \ - --generate-name="${GITHUB_REPOSITORY_NAME_PART}-staging-${GITHUB_SHA_SHORT}-" \ + --generate-name="${GITHUB_REPOSITORY_NAME_PART}-staging-${GITHUB_SHA_SHORT}-${GITHUB_RUN_ATTEMPT}-" \ -p appName="${GITHUB_REPOSITORY_NAME_PART}" \ -p branch="${GITHUB_REF_NAME}" \ -p clusterName="mgmt-20-kubefirst-com" \ @@ -116,11 +131,12 @@ jobs: -p gitUrlNoProtocol="git@github.com:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \ -p shortSha="${GITHUB_SHA_SHORT}" \ --wait --log - - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst" + release: needs: staging runs-on: self-hosted steps: + - name: Setup Runner for Argo run: | cd $HOME @@ -135,17 +151,20 @@ jobs: sudo mv ./argo-linux-amd64 /usr/local/bin/argo # Test installation argo version --short + - name: Check out repository code uses: actions/checkout@v3 + - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 + # todo need to look repositoryGitURL, this needs to be overrideable from here and respected on the template side for both repositories - - name: release + - name: Deploy docs on production run: | echo "commit sha $GITHUB_SHA" argo version --short argo submit .argo/release.yaml \ - --generate-name="${GITHUB_REPOSITORY_NAME_PART}-release-${GITHUB_SHA_SHORT}-" \ + --generate-name="${GITHUB_REPOSITORY_NAME_PART}-release-${GITHUB_SHA_SHORT}-${GITHUB_RUN_ATTEMPT}-" \ -p appName="${GITHUB_REPOSITORY_NAME_PART}" \ -p branch="${GITHUB_REF_NAME}" \ -p clusterName="mgmt-20-kubefirst-com" \ @@ -153,4 +172,3 @@ jobs: -p gitUrlNoProtocol="git@github.com:${GITHUB_REPOSITORY_OWNER_PART_SLUG}" \ -p shortSha="${GITHUB_SHA_SHORT}" \ --wait --log - - run: echo "⭐️ the kubefirst open source platform is powered by github stars. give kubefirst one today https://github.com/kubefirst/kubefirst"