v2.4.4 #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New Release | |
on: | |
release: | |
types: [ created ] | |
# Only run the action when the release tag matches the pattern v[0-9]+.[0-9]+.[0-9]+ | |
branches: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
jobs: | |
# This job packages up the Helm chart | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Package Helm chart | |
run: | | |
TAG=${{ github.event.release.tag_name }} | |
VERSION=${TAG#v} | |
helm package -u -d build --version=$VERSION --app-version=$VERSION . | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: new-release | |
path: build/amrc-connectivity-stack-${{ env.VERSION }}.tgz | |
# This job checks out the release branch, adds the new release to the /builds folder, builds the index and commits | |
# the changes, which triggers Github to release it as a new pages repo | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: release | |
- name: add-new-release | |
uses: actions/download-artifact@v3 | |
with: | |
name: new-release | |
path: build | |
- name: Build index | |
run: | | |
cd build | |
helm repo index --url https://amrc-factoryplus.github.io/amrc-connectivity-stack/build . | |
- name: commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
id: auto_commit_action | |
with: | |
commit_message: Release ${{ github.event.release.tag_name }} | |
commit_user_name: GitHub Action | |
commit_user_email: actions@github.com | |
branch: release | |
create_branch: true | |
push_options: '--force' |