From 9f3c2e9adbe610c9b204b63aa30eab491d34af67 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 18:55:14 +0200 Subject: [PATCH 1/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index b712982..8b5f0c8 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -20,7 +20,7 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Copy .env run: | if [[ ! -f '.env' ]];then @@ -35,7 +35,7 @@ jobs: # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -48,14 +48,17 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sail-${SAIL_VERSION}-app + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=schedule,pattern={{date 'YYYYMMDD-hhmm' tz='Europe/Amsterdam'}} + type=semver,pattern={{version}} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v5 with: context: . push: ${{ github.event_name != 'pull_request' }} From 23d7379aacdf96cab57831788958e40e1160aa9e Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 19:33:54 +0200 Subject: [PATCH 2/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index 8b5f0c8..9d3030f 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -52,8 +52,10 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=schedule,pattern={{date 'YYYYMMDD-hhmm' tz='Europe/Amsterdam'}} - type=semver,pattern={{version}} + type=ref,event=tag + type=semver,pattern={{raw}} + type=schedule,pattern={{date 'YYYYMMDD-hhmmss'tz='Europe/Amsterdam'}} + type=sha # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action From c3fdafb53331b64aae5a62d3365c3d5249c9dee8 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 20:53:28 +0200 Subject: [PATCH 3/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index 0330ef0..19c1424 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -5,15 +5,11 @@ on: env: - # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io - # github.repository as / IMAGE_NAME: ${{ github.repository }} jobs: - # Run tests. - # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: + build: runs-on: ubuntu-latest permissions: contents: read @@ -26,6 +22,12 @@ jobs: if [[ ! -f '.env' ]];then cp '.env.example' '.env' fi + + - name: Dotenv Action + uses: falti/dotenv-action@v1 + with: + export-variables: true + - name: Install Dependencies run: | composer update --lock @@ -43,6 +45,7 @@ jobs: - name: build image based on docker-compose.yml run: docker compose build mensa.php + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action @@ -62,7 +65,10 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: . + context: ./vendor/laravel/sail/runtimes/${SAIL_VERSION:-8.1}/Dockerfile + build-args: WWWGROUP=${WWWGROUP:-1000} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max From 9b42999150fc671035cb0c21ff15898455bf4da4 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 21:05:33 +0200 Subject: [PATCH 4/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index 19c1424..832f450 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -43,10 +43,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: build image based on docker-compose.yml - run: docker compose build mensa.php - - # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata @@ -70,5 +66,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=user/app:buildcache + cache-to: type=registry,ref=user/app:buildcache,mode=max From b4ab7915faae86d659071a8d157285200f798546 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 21:14:06 +0200 Subject: [PATCH 5/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index af32930..00f3305 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -66,6 +66,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=user/app:buildcache - cache-to: type=registry,ref=user/app:buildcache,mode=max From 73785a34aa956206e03575d3eb4a69b819e6130d Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 21:23:39 +0200 Subject: [PATCH 6/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index 00f3305..c1737da 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -61,7 +61,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: ./vendor/laravel/sail/runtimes/${SAIL_VERSION:-8.1}/Dockerfile + context: ${GITHUB_WORKSPACE}/vendor/laravel/sail/runtimes/${SAIL_VERSION:-8.1}/Dockerfile build-args: WWWGROUP=${WWWGROUP:-1000} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} From df667f7b64f5220497a3444195eebb9b605af2c6 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 21:38:33 +0200 Subject: [PATCH 7/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index c1737da..5d77dd8 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Copy .env run: | if [[ ! -f '.env' ]];then @@ -61,8 +63,8 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: ${GITHUB_WORKSPACE}/vendor/laravel/sail/runtimes/${SAIL_VERSION:-8.1}/Dockerfile - build-args: WWWGROUP=${WWWGROUP:-1000} + context: ${{ GITHUB_WORKSPACE }}/vendor/laravel/sail/runtimes/${{ SAIL_VERSION }}/Dockerfile + build-args: WWWGROUP=${{ WWWGROUP }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From dc21a3db50168af20e7f140d57002a514a4112a9 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 21:53:59 +0200 Subject: [PATCH 8/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index 5d77dd8..e0311a2 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -63,8 +63,8 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: ${{ GITHUB_WORKSPACE }}/vendor/laravel/sail/runtimes/${{ SAIL_VERSION }}/Dockerfile - build-args: WWWGROUP=${{ WWWGROUP }} + context: ${{ github.workspace }}/vendor/laravel/sail/runtimes/${{ env.SAIL_VERSION }}/Dockerfile + build-args: WWWGROUP=${{ env.WWWGROUP }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 3b542838cc88c2e33da65707132bf7bed5f18640 Mon Sep 17 00:00:00 2001 From: Martijn <12066560+Kipjr@users.noreply.github.com> Date: Mon, 20 May 2024 22:12:43 +0200 Subject: [PATCH 9/9] Update sail-publish.yml --- .github/workflows/sail-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sail-publish.yml b/.github/workflows/sail-publish.yml index e0311a2..133f6b3 100644 --- a/.github/workflows/sail-publish.yml +++ b/.github/workflows/sail-publish.yml @@ -63,7 +63,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: ${{ github.workspace }}/vendor/laravel/sail/runtimes/${{ env.SAIL_VERSION }}/Dockerfile + context: ${{ github.workspace }}/vendor/laravel/sail/runtimes/${{ env.sail_version }}/Dockerfile build-args: WWWGROUP=${{ env.WWWGROUP }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }}