Merge pull request #272 from fitbeard/dependabot/github_actions/docke… #236
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: build-auto | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
releases: ${{ steps.changes.outputs.changes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create release filters | |
run: | | |
for release in $(ls -dl releases/** | grep "^d" | awk '{ print $9 }') | |
do | |
echo "$release: $release/**" >> .filters.yml | |
done | |
- name: Get changed releases | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: .filters.yml | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
if: ${{ needs.changes.outputs.releases != '[]' }} | |
needs: | |
- changes | |
strategy: | |
fail-fast: false | |
matrix: | |
release: ${{ fromJson(needs.changes.outputs.releases) }} | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Authenticate with Quay.io | |
uses: docker/[email protected] | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r ${{ matrix.release }}/requirements.txt | |
- name: Generate kolla config | |
run: | | |
python kolla-builder.py generate-config -i ${{ matrix.release }}/config.yml -o ${{ matrix.release }}/kolla-build.conf | |
- name: Get release name | |
id: release_name | |
run: | | |
echo name=$(echo ${{ matrix.release }} | sed -r 's/^.{9}//') >> $GITHUB_OUTPUT | |
- name: Build and push kolla images | |
run: | | |
kolla-build --version | |
kolla-build --config-file ${{ matrix.release }}/kolla-build.conf --template-override ${{ matrix.release }}/template-overrides.j2 --profile main --nopush --template-only --work-dir templates-${{ steps.release_name.outputs.name }}-main | |
kolla-build --config-file ${{ matrix.release }}/kolla-build.conf --template-override ${{ matrix.release }}/template-overrides.j2 --profile main --push | |
- name: Upload templates | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: templates-${{ steps.release_name.outputs.name }}-main | |
path: templates-${{ steps.release_name.outputs.name }}-main/ | |
retention-days: 30 |