Merge pull request #26 from jordojordo/main #11
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: Sync and Release Extensions | |
on: | |
release: | |
types: [released] | |
push: | |
branches: | |
- main | |
paths: | |
- manifest.json | |
env: | |
ACTIONS_RUNNER_DEBUG: false | |
CI_COMMIT_MESSAGE: CI Build Artifacts | |
jobs: | |
sync-charts: | |
if: github.repository_owner == 'rancher' && github.ref_type != 'tag' | |
name: Sync and Release Extension Charts | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: write | |
deployments: write | |
pages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure Git | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@github.com | |
- name: Setup Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.1 | |
- name: Setup yq | |
uses: chrisdickinson/[email protected] | |
with: | |
yq-version: v4.34.2 | |
- name: Run sync-charts script | |
shell: bash | |
id: sync_charts_script | |
run: | | |
chmod +x ./scripts/sync-charts | |
./scripts/sync-charts | |
- name: Commit build | |
run: | | |
git add ./{assets,charts,extensions,icons,index.yaml} | |
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git push | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
with: | |
charts_dir: ./charts/* | |
env: | |
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
CR_SKIP_EXISTING: true | |
sync-catalogs: | |
if: github.repository_owner == 'rancher' && github.ref_type == 'tag' | |
name: Sync and Release Extension Catalog | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure Git | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Login to Container Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Sync Catalog Image with Registry | |
id: sync_catalog_script | |
run: | | |
chmod +x ./scripts/bundle-catalog | |
./scripts/bundle-catalog -t ${{ github.ref_name }} |