|
| 1 | +name: Publish Harness FIPS |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - "main" |
| 6 | + push: |
| 7 | + tags: |
| 8 | + - 'v*.*.*' |
| 9 | +env: |
| 10 | + GOPATH: /home/runner/go/ |
| 11 | + GOPROXY: "https://proxy.golang.org" |
| 12 | +jobs: |
| 13 | + |
| 14 | + publish-harness-base: |
| 15 | + name: Build and push harness base FIPS container |
| 16 | + runs-on: ubuntu-20.04 |
| 17 | + permissions: |
| 18 | + contents: 'read' |
| 19 | + id-token: 'write' |
| 20 | + packages: 'write' |
| 21 | + outputs: |
| 22 | + version: ${{ steps.meta.outputs.version }} |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + - name: Docker meta |
| 29 | + id: meta |
| 30 | + uses: docker/metadata-action@v5 |
| 31 | + with: |
| 32 | + # list of Docker images to use as base name for tags |
| 33 | + images: | |
| 34 | + ghcr.io/pluralsh/stackrun-harness-base |
| 35 | + docker.io/pluralsh/stackrun-harness-base |
| 36 | + tags: | |
| 37 | + type=semver,pattern={{version}},suffix=-fips,priority=1000 |
| 38 | + type=sha,suffix=-fips,priority=800 |
| 39 | + type=ref,event=pr,suffix=-fips,priority=600 |
| 40 | + - name: Set up QEMU |
| 41 | + uses: docker/setup-qemu-action@v3 |
| 42 | + - name: Set up Docker Buildx |
| 43 | + uses: docker/setup-buildx-action@v3 |
| 44 | + - name: Login to GHCR |
| 45 | + uses: docker/login-action@v3 |
| 46 | + with: |
| 47 | + registry: ghcr.io |
| 48 | + username: ${{ github.repository_owner }} |
| 49 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + - name: Login to Docker |
| 51 | + uses: docker/login-action@v3 |
| 52 | + with: |
| 53 | + username: mjgpluralsh |
| 54 | + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} |
| 55 | + - name: Build and push |
| 56 | + uses: docker/build-push-action@v5 |
| 57 | + with: |
| 58 | + context: "." |
| 59 | + file: "./dockerfiles/harness/base.fips.Dockerfile" |
| 60 | + push: true |
| 61 | + tags: ${{ steps.meta.outputs.tags }} |
| 62 | + labels: ${{ steps.meta.outputs.labels }} |
| 63 | + platforms: linux/amd64,linux/arm64 |
| 64 | + cache-from: type=gha |
| 65 | + cache-to: type=gha,mode=max |
| 66 | + build-args: | |
| 67 | + VERSION=${{ steps.meta.outputs.version }} |
| 68 | + GO_FIPS_IMAGE_REPO=ghcr.io/pluralsh/go-fips |
| 69 | + GO_FIPS_IMAGE_TAG=1.23.2 |
| 70 | + |
| 71 | + publish-harness-ansible: |
| 72 | + name: Build and push harness ansible FIPS container |
| 73 | + runs-on: ubuntu-20.04 |
| 74 | + needs: [publish-harness-base] |
| 75 | + strategy: |
| 76 | + matrix: |
| 77 | + versions: |
| 78 | + - ansible: '7.7.0' |
| 79 | + python: '3.11' |
| 80 | + tag: '7.7' |
| 81 | + - ansible: '8.7.0' |
| 82 | + python: '3.11' |
| 83 | + tag: '8.7' |
| 84 | + - ansible: '9.0.0' |
| 85 | + python: '3.12' |
| 86 | + tag: '9.0' |
| 87 | + - ansible: '10.0.0' |
| 88 | + python: '3.12' |
| 89 | + tag: '10.0' |
| 90 | + permissions: |
| 91 | + contents: write |
| 92 | + discussions: write |
| 93 | + pull-requests: write |
| 94 | + packages: write |
| 95 | + steps: |
| 96 | + - name: Checkout |
| 97 | + uses: actions/checkout@v4 |
| 98 | + with: |
| 99 | + fetch-depth: 0 |
| 100 | + - name: Docker meta |
| 101 | + id: meta |
| 102 | + uses: docker/metadata-action@v5 |
| 103 | + with: |
| 104 | + images: | |
| 105 | + ghcr.io/pluralsh/harness |
| 106 | + docker.io/pluralsh/harness |
| 107 | + tags: | |
| 108 | + type=semver,pattern={{version}},suffix=-ansible-${{ matrix.versions.tag }}-fips,priority=1000 |
| 109 | + type=sha,suffix=-ansible-${{ matrix.versions.tag }}-fips,priority=800 |
| 110 | + type=ref,event=pr,suffix=-ansible-${{ matrix.versions.tag }}-fips,priority=600 |
| 111 | + - name: Set up QEMU |
| 112 | + uses: docker/setup-qemu-action@v3 |
| 113 | + - name: Set up Docker Buildx |
| 114 | + uses: docker/setup-buildx-action@v3 |
| 115 | + - name: Login to GHCR |
| 116 | + uses: docker/login-action@v3 |
| 117 | + with: |
| 118 | + registry: ghcr.io |
| 119 | + username: ${{ github.repository_owner }} |
| 120 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 121 | + - name: Login to Docker |
| 122 | + uses: docker/login-action@v3 |
| 123 | + with: |
| 124 | + username: mjgpluralsh |
| 125 | + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} |
| 126 | + - name: Build and push |
| 127 | + uses: docker/build-push-action@v5 |
| 128 | + with: |
| 129 | + context: "." |
| 130 | + file: "./dockerfiles/harness/ansible.fips.Dockerfile" |
| 131 | + push: true |
| 132 | + tags: ${{ steps.meta.outputs.tags }} |
| 133 | + labels: ${{ steps.meta.outputs.labels }} |
| 134 | + platforms: linux/amd64,linux/arm64 |
| 135 | + cache-from: type=gha |
| 136 | + cache-to: type=gha,mode=max |
| 137 | + build-args: | |
| 138 | + ANSIBLE_VERSION=${{ matrix.versions.ansible }} |
| 139 | + PYTHON_VERSION=${{ matrix.versions.python }} |
| 140 | + HARNESS_BASE_IMAGE_REPO=ghcr.io/pluralsh/stackrun-harness-base |
| 141 | + HARNESS_BASE_IMAGE_TAG=${{ needs.publish-harness-base.outputs.version }} |
| 142 | + GO_FIPS_IMAGE_REPO=ghcr.io/pluralsh/go-fips |
| 143 | + GO_FIPS_IMAGE_TAG=1.23.2 |
0 commit comments