From 36f87b4a4cb8c746756a82f86dee31fd8905ccd4 Mon Sep 17 00:00:00 2001 From: Craig Gill Date: Tue, 19 Mar 2024 14:31:46 -0700 Subject: [PATCH] fix GH Actions --- .github/workflows/build-dev-image.yml | 8 +++++++- .github/workflows/build-release-image.yml | 22 +++++++++++----------- README.md | 10 +++++----- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-dev-image.yml b/.github/workflows/build-dev-image.yml index 4da67ba..9d1b80c 100644 --- a/.github/workflows/build-dev-image.yml +++ b/.github/workflows/build-dev-image.yml @@ -15,32 +15,38 @@ env: COMMIT_SHA: ${{ github.sha }} jobs: - build_image: + build_jira_dev_image: runs-on: ubuntu-latest steps: - name: Checkout 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: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for the Docker image id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build, Tag, and push Docker image uses: docker/build-push-action@v5 with: context: ./app push: ${{ github.event_name != 'pull_request' }} tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ vars.DEVELOP_TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build-release-image.yml b/.github/workflows/build-release-image.yml index f0284a7..51c255b 100644 --- a/.github/workflows/build-release-image.yml +++ b/.github/workflows/build-release-image.yml @@ -14,40 +14,40 @@ env: COMMIT_SHA: ${{ github.sha }} jobs: - build_image: + build_jira_prod_image: runs-on: ubuntu-latest steps: - name: Checkout 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 - with: - buildkitd-flags: debug + - name: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ env.GITHUB_TOKEN }} - env: - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for the Docker image id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - ${{ env.COMMIT_SHA }} - ${{ vars.RELEASE_TAG}} + - name: Build, Tag, and push Docker image uses: docker/build-push-action@v5 with: context: ./app push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.COMMIT_SHA }} + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ vars.RELEASE_TAG }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMMIT_SHA}} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} build-args: | BUILD_TAG=${{ vars.RELEASE_TAG }} diff --git a/README.md b/README.md index 6b5d1dd..194c973 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Jira Software -This repo is responsible for creating the Atlassian Jira Docker image for our internal use. +This repo is responsible for creating the Atlassian Jira Docker images for our internal use that has been customized with a MySQL ODBC Connector. There's not a lot going on in repo itself other than defining a Dockerfile and a few GitHub Actions. ## Usage -To build an image for Jira Software, simply trigger a new run of the default pipeline for this repo via the [GitLab UI](https://it-gitlab.slickdeals.dev/itops/jira-software/-/pipelines) +To trigger a build of the Dev Jira Docker Image, make your changes in a branch and open a PR against the develop branch. Check the status of [GH Action](https://github.com/Slickdeals/jira-software/actions/workflows/build-dev-image.yml) and view the output of the job run for your changes. -The image will be built from the Dockerfile in the `app` folder of this repo. There are two images that will be built from these pipelines, an image for use with our Dev environment, and an image for our Production Jira instance. +Once you are happy with your changes, merge your PR into the develop branch. This will trigger a build of the Dev Jira Docker Image and push it to the Slickdeals GHCR. -Once built, the Docker Image will be tagged with the Git Commit SHA and the version of Jira Software that was used to build the image. +Merging your changes against the develop branch will trigger a Push of the Dev Jira Docker Image to the Slickdeals GHCR. -The resulting image will be pushed to the Slickdeals GHCR for use on our systems. +Once changes have been tested against the develop branch, they can be merged into the main branch. This will trigger a build of the Production Jira Docker Image and push it to the Slickdeals GHCR.