|
| 1 | +name: almalinux8-ansible-latest |
| 2 | +on: |
| 3 | + # yamllint disable-line rule:truthy |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - 'almalinux8-ansible-latest/**' |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - 'almalinux8-ansible-latest/**' |
| 11 | +jobs: |
| 12 | + docker: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: read |
| 16 | + packages: write |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + dockerimage: |
| 21 | + - almalinux8-ansible |
| 22 | + platforms: |
| 23 | + - linux/amd64 |
| 24 | + #- linux/arm64 |
| 25 | + steps: |
| 26 | + - |
| 27 | + name: Checkout |
| 28 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 29 | + - |
| 30 | + name: Set up QEMU |
| 31 | + uses: docker/setup-qemu-action@v3 |
| 32 | + - |
| 33 | + name: Set up Docker Buildx |
| 34 | + uses: docker/setup-buildx-action@v3 |
| 35 | + - |
| 36 | + name: Build and export to Docker |
| 37 | + uses: docker/build-push-action@v6 |
| 38 | + with: |
| 39 | + context: ${{ matrix.dockerimage }}-latest |
| 40 | + tags: docker-${{ matrix.dockerimage }}:test |
| 41 | + platforms: ${{ matrix.platforms }} |
| 42 | + load: true |
| 43 | + - |
| 44 | + name: Test |
| 45 | + run: | |
| 46 | + docker run --rm docker-${{ matrix.dockerimage }}:test |
| 47 | + - |
| 48 | + name: Login to ghcr.io |
| 49 | + uses: docker/login-action@v3 |
| 50 | + with: |
| 51 | + registry: ghcr.io |
| 52 | + username: ${{ github.actor }} |
| 53 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + if: github.ref == 'refs/heads/master' |
| 55 | + - |
| 56 | + name: Build and push to ghcr.io |
| 57 | + uses: docker/build-push-action@v6 |
| 58 | + with: |
| 59 | + context: ${{ matrix.dockerimage }}-latest |
| 60 | + push: true |
| 61 | + tags: ghcr.io/dev-sec/docker-${{ matrix.dockerimage }}:latest |
| 62 | + platforms: ${{ matrix.platforms }} |
| 63 | + if: github.ref == 'refs/heads/master' |
| 64 | + - |
| 65 | + name: Login to DockerHub |
| 66 | + uses: docker/login-action@v3 |
| 67 | + with: |
| 68 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 69 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 70 | + if: github.ref == 'refs/heads/master' |
| 71 | + - |
| 72 | + name: Build and push |
| 73 | + uses: docker/build-push-action@v6 |
| 74 | + with: |
| 75 | + context: ${{ matrix.dockerimage }}-latest |
| 76 | + push: true |
| 77 | + tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-${{ matrix.dockerimage }}:latest |
| 78 | + platforms: ${{ matrix.platforms }} |
| 79 | + if: github.ref == 'refs/heads/master' |
0 commit comments