Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workflow rerun + some cleanup #356

Merged
merged 8 commits into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Release new docs
env:
ARGO_NAMESPACE: argo
ARGO_VERSION: v3.4.1
Expand All @@ -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
Expand All @@ -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="[email protected]:${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
Expand All @@ -63,28 +71,32 @@ 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" \
-p environment="development" \
-p gitUrlNoProtocol="[email protected]:${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
Expand All @@ -99,28 +111,32 @@ 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" \
-p environment="staging" \
-p gitUrlNoProtocol="[email protected]:${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
Expand All @@ -135,22 +151,24 @@ 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" \
-p environment="production" \
-p gitUrlNoProtocol="[email protected]:${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"
Loading