Version 1.0.0 #1
Workflow file for this run
This file contains hidden or 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: Docker - Release | |
| on: | |
| push: | |
| tags: [ '*.*.*' ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| prepare: | |
| name: Prepare Matrix | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ansible-versions: ${{ steps.set-matrix.outputs.ansible-versions }} | |
| latest-version: ${{ steps.set-matrix.outputs.latest-version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set Matrix | |
| id: set-matrix | |
| run: | | |
| matrix=$(cat docker/config.json | jq -c '.ansible.versions') | |
| latest=$(cat docker/config.json | jq -r '.ansible.versions[0]') | |
| echo "ansible-versions=$matrix" >> $GITHUB_OUTPUT | |
| echo "latest-version=$latest" >> $GITHUB_OUTPUT | |
| registry: | |
| name: Build & Push | |
| runs-on: ubuntu-latest | |
| needs: prepare | |
| strategy: | |
| matrix: | |
| ansible-version: ${{ fromJson(needs.prepare.outputs.ansible-versions) }} | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=${{ matrix.ansible-version }} | |
| type=raw,value=${{ matrix.ansible-version }}-${{ github.ref_name }} | |
| type=raw,value=latest,enable=${{ matrix.ansible-version == needs.prepare.outputs.latest-version }} | |
| - name: Build and Push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./docker | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| ANSIBLE_VERSION=${{ matrix.ansible-version }} |