|
3 | 3 | push: |
4 | 4 | paths: |
5 | 5 | - charts/** |
| 6 | + - .github/workflows/** |
6 | 7 | pull_request: |
7 | 8 | paths: |
8 | 9 | - charts/** |
| 10 | + - .github/workflows/** |
9 | 11 |
|
10 | 12 | jobs: |
11 | | - lint-test: |
12 | | - name: "Lint and Test" |
| 13 | + lint-charts: |
| 14 | + name: Lint Charts |
13 | 15 | runs-on: ubuntu-22.04 |
14 | 16 | steps: |
15 | 17 | - name: "Checkout" |
@@ -55,45 +57,98 @@ jobs: |
55 | 57 | run: ct lint --config ct.yaml |
56 | 58 | if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' |
57 | 59 |
|
| 60 | + install-charts: |
| 61 | + name: Install Charts |
| 62 | + runs-on: ubuntu-22.04 |
| 63 | + steps: |
| 64 | + - name: "Checkout" |
| 65 | + uses: actions/checkout@v2.4.2 |
| 66 | + with: |
| 67 | + fetch-depth: 0 |
| 68 | + |
| 69 | + - name: "Set Up Helm" |
| 70 | + uses: azure/setup-helm@v3.3 |
| 71 | + if: github.ref != 'refs/heads/main' |
| 72 | + with: |
| 73 | + version: v3.4.1 |
| 74 | + |
| 75 | + - name: "Set Up Python" |
| 76 | + uses: actions/setup-python@v4.2.0 |
| 77 | + if: github.ref != 'refs/heads/main' |
| 78 | + with: |
| 79 | + python-version: 3.9 |
| 80 | + |
| 81 | + - name: "Set up chart-testing" |
| 82 | + uses: helm/chart-testing-action@v2.3.0 |
| 83 | + if: github.ref != 'refs/heads/main' |
| 84 | + with: |
| 85 | + version: v3.3.0 |
| 86 | + |
| 87 | + - name: "Save Testing Values from Secret" |
| 88 | + shell: bash |
| 89 | + env: |
| 90 | + SECRET_VALUES: ${{ secrets.FOUNDRY_SECRET_VALUES }} |
| 91 | + run: echo "$SECRET_VALUES" | base64 -d > ./charts/foundry-vtt/ci/test-values.yaml |
| 92 | + if: github.ref != 'refs/heads/main' |
| 93 | + |
| 94 | + - name: "Run chart-testing (list-changed)" |
| 95 | + id: list-changed |
| 96 | + if: github.ref != 'refs/heads/main' |
| 97 | + run: | |
| 98 | + changed=$(ct list-changed --config ct.yaml) |
| 99 | + if [[ -n "$changed" ]]; then |
| 100 | + echo "::set-output name=changed::true" |
| 101 | + fi |
| 102 | +
|
58 | 103 | - name: Create kind cluster |
59 | 104 | uses: helm/kind-action@v1.4.0 |
60 | 105 | if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' |
61 | 106 |
|
62 | 107 | - name: Run chart-testing (install) |
63 | | - run: ct install --config ct.yaml |
| 108 | + run: ct install --config ct.yaml --debug |
64 | 109 | if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/main' |
65 | 110 |
|
66 | | - - name: Get Branch name |
67 | | - id: branch-name |
68 | | - uses: tj-actions/branch-names@v6 |
69 | | - if: github.ref != 'refs/heads/main' |
70 | | - |
71 | | - release_on_nexus: |
| 111 | + release-on-nexus: |
72 | 112 | name: Release Chart on Nexus |
73 | 113 | runs-on: ubuntu-22.04 |
74 | | - needs: lint-test |
| 114 | + needs: |
| 115 | + - lint-charts |
| 116 | + - install-charts |
75 | 117 | if: github.ref == 'refs/heads/main' |
76 | 118 | steps: |
77 | 119 | - name: Checkout |
78 | 120 | uses: actions/checkout@v2 |
79 | 121 | with: |
| 122 | + submodule: recursive |
80 | 123 | fetch-depth: 0 |
81 | 124 |
|
82 | 125 | - name: Configure Git |
83 | 126 | run: | |
84 | 127 | git config user.name "$GITHUB_ACTOR" |
85 | 128 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" |
86 | | -
|
87 | | - - name: Install Helm |
88 | | - uses: azure/setup-helm@v1 |
89 | | - with: |
90 | | - version: v3.4.0 |
91 | | - |
92 | 129 | - name: Run chart-releaser |
93 | | - uses: ntwklr/nexus-helm-chart-releaser-action@v0.0.5 |
| 130 | + uses: helm/chart-releaser-action@v1.1.0 |
94 | 131 | env: |
95 | 132 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 133 | + |
| 134 | + - name: Setup Hugo |
| 135 | + uses: peaceiris/actions-hugo@v2 |
| 136 | + with: |
| 137 | + hugo-version: 'latest' |
| 138 | + |
| 139 | + - name: Build Hugo |
| 140 | + run: | |
| 141 | + git submodule init |
| 142 | + git submodule update |
| 143 | + cd hugo |
| 144 | + hugo --minify |
| 145 | + cp -r ./public ../public |
| 146 | + cd .. |
| 147 | +
|
| 148 | + - name: Deploy Hugo |
| 149 | + uses: peaceiris/actions-gh-pages@v3 |
96 | 150 | with: |
97 | | - charts_repo_url: https://repo.mahahe.it/repository/helm/ |
98 | | - username: "${{ secrets.NEXUS_USERNAME }}" |
99 | | - password: "${{ secrets.NEXUS_PASSWORD }}" |
| 151 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 152 | + publish_dir: ./public |
| 153 | + cname: helm.mahahe.it |
| 154 | + keep_files: true |
0 commit comments