From 431d1ddf0296898e7fb98f40d2f504828c7b1084 Mon Sep 17 00:00:00 2001 From: Mathieu Ducrot Date: Wed, 3 Jan 2024 10:30:45 +0100 Subject: [PATCH 1/2] Remove the on pull_request trigger of build CI file Also reformat the comment to not be in a single line --- .github/workflows/build.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ff4624..dfd70ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,40 +1,55 @@ # Inspiration : https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions name: Create and publish a Docker image -on: [ pull_request, workflow_dispatch ] +# Configures this workflow to run only on demand. +on: [ workflow_dispatch ] env: - REGISTRY: ghcr.io # Container registry domain - IMAGE_NAME: ${{ github.repository }} # Name for the Docker image + # Container registry domain + REGISTRY: ghcr.io + # Name for the Docker image + IMAGE_NAME: ${{ github.repository }} NODE_VERSION: 18.17.0 +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: - push: + build-and-push: runs-on: ubuntu-latest strategy: matrix: php_data: - {php_version: 8.2, push: true} - {php_version: 8.1, push: false} - permissions: # Sets the permissions granted to the GITHUB_TOKEN for the actions in this job. + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: packages: write contents: read steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Log in to the Container registry # 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. + # Uses the `docker/login-action` action to log in to the Container 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@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker # This step uses docker/metadata-action 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. + # 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@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: php${{ matrix.php_data.php_version }} - - name: Build and push Docker image # 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" 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. + # 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 uses: docker/build-push-action@v5 with: context: . From 1cf1e51bdaea7d3770ea941257ec99cdac2e363d Mon Sep 17 00:00:00 2001 From: Mathieu Ducrot Date: Wed, 3 Jan 2024 10:31:31 +0100 Subject: [PATCH 2/2] Remove the .github directory on the docker-post-fetch command --- make/docker.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/make/docker.mk b/make/docker.mk index 26b9b5f..a03a35d 100644 --- a/make/docker.mk +++ b/make/docker.mk @@ -15,6 +15,7 @@ df: docker-fetch ## Alias for docker-fetch .PHONY: docker-post-fetch docker-post-fetch: ## Post smartbooster/symfony-docker fetch process to clean unwanted files to be sync git restore --staged .env.skeleton + rm -rf .github rm -f .env.skeleton git restore --staged package.json git restore package.json