From 73484de432c667715529250eebdeebf2e242d062 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 23 May 2024 16:43:04 +0100 Subject: [PATCH 1/9] Attempting to build an image and push to container repo --- .github/workflows/deploy-image.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/deploy-image.yml diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml new file mode 100644 index 0000000..5a0c093 --- /dev/null +++ b/.github/workflows/deploy-image.yml @@ -0,0 +1,59 @@ +# +name: Create and publish a Docker image + +# Configures this workflow to run every time a change is pushed to the branch called `release`. +on: + push: + branches: ['jelastic-spike'] + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + attestations: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + From c2947ee14e6356238c284c0bf56bb9e0f89c93c5 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 23 May 2024 16:55:02 +0100 Subject: [PATCH 2/9] add shopify secret --- .github/workflows/deploy-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 5a0c093..12e7c79 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -15,6 +15,8 @@ env: jobs: build-and-push-image: runs-on: ubuntu-latest + env: + SHOPIFY_API_KEY: ${{ secrets.SHOPIFY_API_KEY }} # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: contents: read From 894a351d7a2c59f8442afd271658db2ae7a5ef61 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 23 May 2024 16:56:24 +0100 Subject: [PATCH 3/9] add shopify secret --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a5c6b8..3177dbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM node:18-alpine -ARG SHOPIFY_API_KEY -ENV SHOPIFY_API_KEY=$SHOPIFY_API_KEY EXPOSE 8081 WORKDIR /app COPY web . From 868ede64fabd845013486f10a545b174591b0676 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 4 Jul 2024 12:16:48 +0100 Subject: [PATCH 4/9] build and push a docker container to jelastic --- .github/build-and-deploy.yml | 72 ++++++++++++++++++++++++++ .github/deploy-staging.yml | 18 +++++++ .github/workflows/build-and-deploy.yml | 72 ++++++++++++++++++++++++++ .github/workflows/deploy-image.yml | 61 ---------------------- .github/workflows/deploy-staging.yml | 18 +++++++ Dockerfile | 3 ++ 6 files changed, 183 insertions(+), 61 deletions(-) create mode 100644 .github/build-and-deploy.yml create mode 100644 .github/deploy-staging.yml create mode 100644 .github/workflows/build-and-deploy.yml delete mode 100644 .github/workflows/deploy-image.yml create mode 100644 .github/workflows/deploy-staging.yml diff --git a/.github/build-and-deploy.yml b/.github/build-and-deploy.yml new file mode 100644 index 0000000..eceaed8 --- /dev/null +++ b/.github/build-and-deploy.yml @@ -0,0 +1,72 @@ +name: Create and publish a Docker image +on: + workflow_call: + inputs: + jelastic_env: + description: 'Jelastic environment name' + required: true + type: string + image_name: + description: 'Name for image' + required: false + default: ${{ github.repository }} + type: string + secrets: + jelastic_access_token: + required: true + shopify_api_key: + required: true + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + env: + SHOPIFY_API_KEY: ${{ secrets.shopify_api_key }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ghcr.io/${{ inputs.image_name }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=sha + type=sha,prefix={{branch}}- + + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + build-args: | + SHOPIFY_API_KEY=${{ secrets.shopify_api_key }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." + # - name: Generate artifact attestation + # uses: actions/attest-build-provenance@v1 + # with: + # subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + # subject-digest: ${{ steps.push.outputs.digest }} + # push-to-registry: true + - name: Redeploy containers + run: | + sudo apt-get install curl -y + curl https://app.jpc.infomaniak.com/1.0/environment/control/rest/redeploycontainersbygroup?envName=${{inputs.jelastic_env}}\&session=${{secrets.jelastic_access_token}}\&tag=${{steps.meta.outputs.tags[0]}}\&nodeGroup=cp \ No newline at end of file diff --git a/.github/deploy-staging.yml b/.github/deploy-staging.yml new file mode 100644 index 0000000..557c752 --- /dev/null +++ b/.github/deploy-staging.yml @@ -0,0 +1,18 @@ +name: Create and publish a Docker image + +on: + push: + branches: ['jelastic'] + +jobs: + build-and-push-image: + permissions: + contents: read + packages: write + attestations: write + id-token: write + uses: ./.github/workflows/build-and-deploy.yml + with: + jelastic_env: env-0105831 + secrets: inherit + \ No newline at end of file diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..eceaed8 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,72 @@ +name: Create and publish a Docker image +on: + workflow_call: + inputs: + jelastic_env: + description: 'Jelastic environment name' + required: true + type: string + image_name: + description: 'Name for image' + required: false + default: ${{ github.repository }} + type: string + secrets: + jelastic_access_token: + required: true + shopify_api_key: + required: true + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + env: + SHOPIFY_API_KEY: ${{ secrets.shopify_api_key }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ghcr.io/${{ inputs.image_name }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=sha + type=sha,prefix={{branch}}- + + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + build-args: | + SHOPIFY_API_KEY=${{ secrets.shopify_api_key }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." + # - name: Generate artifact attestation + # uses: actions/attest-build-provenance@v1 + # with: + # subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + # subject-digest: ${{ steps.push.outputs.digest }} + # push-to-registry: true + - name: Redeploy containers + run: | + sudo apt-get install curl -y + curl https://app.jpc.infomaniak.com/1.0/environment/control/rest/redeploycontainersbygroup?envName=${{inputs.jelastic_env}}\&session=${{secrets.jelastic_access_token}}\&tag=${{steps.meta.outputs.tags[0]}}\&nodeGroup=cp \ No newline at end of file diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml deleted file mode 100644 index 12e7c79..0000000 --- a/.github/workflows/deploy-image.yml +++ /dev/null @@ -1,61 +0,0 @@ -# -name: Create and publish a Docker image - -# Configures this workflow to run every time a change is pushed to the branch called `release`. -on: - push: - branches: ['jelastic-spike'] - -# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. -jobs: - build-and-push-image: - runs-on: ubuntu-latest - env: - SHOPIFY_API_KEY: ${{ secrets.SHOPIFY_API_KEY }} - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. - permissions: - contents: read - packages: write - attestations: write - # - steps: - - name: Checkout repository - uses: actions/checkout@v4 - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - - name: Build and push Docker image - id: push - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true - diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 0000000..4de1562 --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,18 @@ +name: Create and publish a Docker image + +on: + push: + branches: ['jelastic'] + +jobs: + build-and-push-image: + permissions: + contents: read + packages: write + attestations: write + id-token: write + uses: ./.github/workflows/build-and-deploy.yml + with: + jelastic_env: env-9448736 + secrets: inherit + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3177dbc..66d7b71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:18-alpine +ARG SHOPIFY_API_KEY +ENV SHOPIFY_API_KEY=$SHOPIFY_API_KEY + EXPOSE 8081 WORKDIR /app COPY web . From d3b98f14672b107e187780c0a6ecaf000abb96ba Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 4 Jul 2024 12:18:50 +0100 Subject: [PATCH 5/9] build and push a docker container to jelastic --- .github/deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/deploy-staging.yml b/.github/deploy-staging.yml index 557c752..f29b092 100644 --- a/.github/deploy-staging.yml +++ b/.github/deploy-staging.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['jelastic'] + branches: ['jelastic-spike'] jobs: build-and-push-image: From 49ca8a907e77f54d0e64a9bee3366afe3427eb38 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 4 Jul 2024 12:20:38 +0100 Subject: [PATCH 6/9] build and push a docker container to jelastic --- .github/build-and-deploy.yml | 72 ---------------------------- .github/deploy-staging.yml | 18 ------- .github/workflows/deploy-staging.yml | 2 +- 3 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 .github/build-and-deploy.yml delete mode 100644 .github/deploy-staging.yml diff --git a/.github/build-and-deploy.yml b/.github/build-and-deploy.yml deleted file mode 100644 index eceaed8..0000000 --- a/.github/build-and-deploy.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Create and publish a Docker image -on: - workflow_call: - inputs: - jelastic_env: - description: 'Jelastic environment name' - required: true - type: string - image_name: - description: 'Name for image' - required: false - default: ${{ github.repository }} - type: string - secrets: - jelastic_access_token: - required: true - shopify_api_key: - required: true - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - env: - SHOPIFY_API_KEY: ${{ secrets.shopify_api_key }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ghcr.io/${{ inputs.image_name }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=ref,event=tag - type=sha - type=sha,prefix={{branch}}- - - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - - name: Build and push Docker image - id: push - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 - with: - context: . - push: true - build-args: | - SHOPIFY_API_KEY=${{ secrets.shopify_api_key }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." - # - name: Generate artifact attestation - # uses: actions/attest-build-provenance@v1 - # with: - # subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - # subject-digest: ${{ steps.push.outputs.digest }} - # push-to-registry: true - - name: Redeploy containers - run: | - sudo apt-get install curl -y - curl https://app.jpc.infomaniak.com/1.0/environment/control/rest/redeploycontainersbygroup?envName=${{inputs.jelastic_env}}\&session=${{secrets.jelastic_access_token}}\&tag=${{steps.meta.outputs.tags[0]}}\&nodeGroup=cp \ No newline at end of file diff --git a/.github/deploy-staging.yml b/.github/deploy-staging.yml deleted file mode 100644 index f29b092..0000000 --- a/.github/deploy-staging.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Create and publish a Docker image - -on: - push: - branches: ['jelastic-spike'] - -jobs: - build-and-push-image: - permissions: - contents: read - packages: write - attestations: write - id-token: write - uses: ./.github/workflows/build-and-deploy.yml - with: - jelastic_env: env-0105831 - secrets: inherit - \ No newline at end of file diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 4de1562..06960b4 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['jelastic'] + branches: ['jelastic-spike'] jobs: build-and-push-image: From 08835a2c4cd2a0a33899a408aa564499da7bb276 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 4 Jul 2024 13:19:05 +0100 Subject: [PATCH 7/9] fixes --- .github/workflows/build-and-deploy.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index eceaed8..2166d16 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -35,14 +35,9 @@ jobs: # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: - images: ghcr.io/${{ inputs.image_name }} tags: | - type=ref,event=branch - type=ref,event=pr - type=ref,event=tag - type=sha type=sha,prefix={{branch}}- # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. @@ -56,7 +51,7 @@ jobs: push: true build-args: | SHOPIFY_API_KEY=${{ secrets.shopify_api_key }} - tags: ${{ steps.meta.outputs.tags }} + tags: ghcr.io/${{ inputs.image_name }}:${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." @@ -69,4 +64,4 @@ jobs: - name: Redeploy containers run: | sudo apt-get install curl -y - curl https://app.jpc.infomaniak.com/1.0/environment/control/rest/redeploycontainersbygroup?envName=${{inputs.jelastic_env}}\&session=${{secrets.jelastic_access_token}}\&tag=${{steps.meta.outputs.tags[0]}}\&nodeGroup=cp \ No newline at end of file + curl https://app.jpc.infomaniak.com/1.0/environment/control/rest/redeploycontainersbygroup?envName=${{inputs.jelastic_env}}\&session=${{secrets.jelastic_access_token}}\&tag=${{steps.meta.outputs.tags}}\&nodeGroup=cp \ No newline at end of file From 466d7c7ca605011f65519621362426b21ef16e85 Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Thu, 4 Jul 2024 13:22:02 +0100 Subject: [PATCH 8/9] repoint to staging --- .github/workflows/deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 06960b4..b4ae326 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['jelastic-spike'] + branches: ['staging'] jobs: build-and-push-image: From 0cee723871ce56ee2b583dd75888604c1e13d48d Mon Sep 17 00:00:00 2001 From: Alex Luker Date: Mon, 29 Jul 2024 09:38:33 +0100 Subject: [PATCH 9/9] Remove the ability to edit a sales session as we dont support it on the producer. Change throw error to attach the error as a cause so we can add the meaningful description. Couldnt find out the ecmascript version shopify is using to know whether this is fully supported --- web/frontend/pages/SalesSession.jsx | 50 ------------------- .../controllers/edit-current-sales-session.js | 45 ----------------- .../sales-session/controllers/index.js | 2 - .../use-cases/edit-current-sales-session.js | 30 ----------- web/oidc-router.js | 2 +- web/utils/index.js | 7 +-- 6 files changed, 2 insertions(+), 134 deletions(-) delete mode 100644 web/modules/sales-session/controllers/edit-current-sales-session.js delete mode 100644 web/modules/sales-session/use-cases/edit-current-sales-session.js diff --git a/web/frontend/pages/SalesSession.jsx b/web/frontend/pages/SalesSession.jsx index 2d19555..b3a5a53 100644 --- a/web/frontend/pages/SalesSession.jsx +++ b/web/frontend/pages/SalesSession.jsx @@ -90,22 +90,6 @@ export default function SalesSession() { }, }); - const { - mutateAsync: editCurrentSalesSession, - isLoading: editCurrentSalesSessionIsLoading, - error: editCurrentSalesSessionError, - } = useAppMutation({ - reactQueryOptions: { - onSuccess: async () => { - await queryClient.invalidateQueries("/api/sales-session"); - setShowSuccessAlert({ - show: true, - type: "updated", - }); - }, - }, - }); - const { mutateAsync: completeCurrentSalesSession, isLoading: completeCurrentSalesSessionIsLoading, @@ -134,22 +118,6 @@ export default function SalesSession() { }, }); - const handleOnEditCurrentSalesSessionClick = async () => { - await editCurrentSalesSession({ - url: "/api/sales-session/current", - fetchInit: { - method: "PATCH", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - startDate: startDate.toISOString(), - sessionDurationInDays: Number(sessionDurationInDays), - }), - }, - }); - }; - const handleOnFinishCurrentSalesSessionClick = async () => { await completeCurrentSalesSession({ url: "/api/sales-session/current/complete", @@ -314,20 +282,6 @@ export default function SalesSession() { {createSalesSessionIsLoading ? "Loading..." : "Create Sales Session"} - -