From 2109ea5296daea135a072d5e2a5c24ee6bf437ee Mon Sep 17 00:00:00 2001 From: "l.h. riley" Date: Thu, 31 Aug 2023 16:18:39 -0700 Subject: [PATCH 1/5] DEVOPS-1626 - Add Github Action for container release --- .github/workflows/release-container.yaml | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release-container.yaml diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml new file mode 100644 index 000000000..187c50beb --- /dev/null +++ b/.github/workflows/release-container.yaml @@ -0,0 +1,51 @@ +# ref: https://github.com/marketplace/actions/build-and-push-docker-images + +name: Release container image + +on: + release: + types: [published] + +jobs: + context: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push: true + + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + + platforms: | + linux/amd64 + linux/arm64 + darwin/amd64 + darwin/arm64 + + tags: | + latest + ${{ github.event.release.tag_name }} + + outputs: | + image: ${{ steps.build.outputs.imageid }} + digest: ${{ steps.build.outputs.digest }} + metadata: ${{ steps.build.outputs.metadata }} From 47699c56d8e0888a79fc2dd019649170fab488f3 Mon Sep 17 00:00:00 2001 From: "l.h. riley" Date: Thu, 31 Aug 2023 16:42:05 -0700 Subject: [PATCH 2/5] DEVOPS-1626 - Add Github Action for testing container --- .github/workflows/testing-container.yaml | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/testing-container.yaml diff --git a/.github/workflows/testing-container.yaml b/.github/workflows/testing-container.yaml new file mode 100644 index 000000000..8a4402a63 --- /dev/null +++ b/.github/workflows/testing-container.yaml @@ -0,0 +1,52 @@ +# ref: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images + +name: Testing container image + +on: + push: + branches: + - 'develop' + +jobs: + context: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push: true + + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + + platforms: | + linux/amd64 + linux/arm64 + darwin/amd64 + darwin/arm64 + + tags: | + develop + ${{ github.sha }} + + outputs: | + image: ${{ steps.build.outputs.imageid }} + digest: ${{ steps.build.outputs.digest }} + metadata: ${{ steps.build.outputs.metadata }} From b8f4c65edbf81e9dc795eb5560459fdf196528ab Mon Sep 17 00:00:00 2001 From: "l.h. riley" Date: Thu, 31 Aug 2023 16:51:17 -0700 Subject: [PATCH 3/5] DEVOPS-1626 - hardcode github container registry --- .github/workflows/release-container.yaml | 2 +- .github/workflows/testing-container.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml index 187c50beb..ea6ef86e0 100644 --- a/.github/workflows/release-container.yaml +++ b/.github/workflows/release-container.yaml @@ -21,7 +21,7 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v2 with: - registry: ${{ env.REGISTRY }} + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/testing-container.yaml b/.github/workflows/testing-container.yaml index 8a4402a63..950f96d71 100644 --- a/.github/workflows/testing-container.yaml +++ b/.github/workflows/testing-container.yaml @@ -22,7 +22,7 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v2 with: - registry: ${{ env.REGISTRY }} + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From f401cb9488f92dd150612406133951ed3cbc9e43 Mon Sep 17 00:00:00 2001 From: "l.h. riley" Date: Thu, 31 Aug 2023 17:00:50 -0700 Subject: [PATCH 4/5] DEVOPS-1626 - remove outputs --- .github/workflows/release-container.yaml | 5 ----- .github/workflows/testing-container.yaml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml index ea6ef86e0..4ad1cbcbe 100644 --- a/.github/workflows/release-container.yaml +++ b/.github/workflows/release-container.yaml @@ -44,8 +44,3 @@ jobs: tags: | latest ${{ github.event.release.tag_name }} - - outputs: | - image: ${{ steps.build.outputs.imageid }} - digest: ${{ steps.build.outputs.digest }} - metadata: ${{ steps.build.outputs.metadata }} diff --git a/.github/workflows/testing-container.yaml b/.github/workflows/testing-container.yaml index 950f96d71..338fec057 100644 --- a/.github/workflows/testing-container.yaml +++ b/.github/workflows/testing-container.yaml @@ -45,8 +45,3 @@ jobs: tags: | develop ${{ github.sha }} - - outputs: | - image: ${{ steps.build.outputs.imageid }} - digest: ${{ steps.build.outputs.digest }} - metadata: ${{ steps.build.outputs.metadata }} From ea20b8126d6b80a0bb14e01798657f8ee5af942a Mon Sep 17 00:00:00 2001 From: "l.h. riley" Date: Thu, 31 Aug 2023 17:06:20 -0700 Subject: [PATCH 5/5] DEVOPS-1626 - remove darwin from platforms, unsupported in FROM image --- .github/workflows/release-container.yaml | 2 -- .github/workflows/testing-container.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml index 4ad1cbcbe..28cd4122a 100644 --- a/.github/workflows/release-container.yaml +++ b/.github/workflows/release-container.yaml @@ -38,8 +38,6 @@ jobs: platforms: | linux/amd64 linux/arm64 - darwin/amd64 - darwin/arm64 tags: | latest diff --git a/.github/workflows/testing-container.yaml b/.github/workflows/testing-container.yaml index 338fec057..6d43f996a 100644 --- a/.github/workflows/testing-container.yaml +++ b/.github/workflows/testing-container.yaml @@ -39,8 +39,6 @@ jobs: platforms: | linux/amd64 linux/arm64 - darwin/amd64 - darwin/arm64 tags: | develop