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: Ubuntu Development Image Build and Publish | |
| on: | |
| push: | |
| paths: | |
| - 'source/env_dev/ubuntu/env_ubuntu.conf' | |
| - 'source/env_dev/ubuntu/env_ubuntu_20.04.conf' | |
| - 'source/env_dev/ubuntu/env_ubuntu_22.04.conf' | |
| - 'source/env_dev/ubuntu/env_ubuntu_24.04.conf' | |
| - '.github/workflows/devops-ubuntu-dev.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| ubuntu-version: [20.04, 22.04, 24.04] | |
| platforms: [linux/amd64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate Dockerfile | |
| run: | | |
| cd source/env_dev/ubuntu | |
| chmod +x env_ubuntu_gen.sh | |
| ./env_ubuntu_gen.sh | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: source/env_dev/ubuntu | |
| file: source/env_dev/ubuntu/Dockerfile.ubuntu${{ matrix.ubuntu-version }} | |
| push: true | |
| platforms: ${{ matrix.platforms }} | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/ubuntu-dev:${{ matrix.ubuntu-version }}-latest | |
| ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/ubuntu-dev:${{ matrix.ubuntu-version }} | |
| ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/ubuntu-dev:${{ matrix.ubuntu-version }}-${{ github.sha }} | |
| labels: | | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| org.opencontainers.image.version=${{ matrix.ubuntu-version }} | |
| org.opencontainers.image.created=${{ github.event.repository.created_at }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| - name: Clean up generated files | |
| run: | | |
| cd source/env_dev/ubuntu | |
| rm Dockerfile.ubuntu* install_packages_ubuntu*.sh |