From f60ec850f0e440aa12eff7479f244deb8e3da1b0 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Thu, 1 Aug 2024 08:12:33 +0000 Subject: [PATCH 1/3] Ci : fix repo name in tag --- .gitea/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index c21dc27..6ef3e5b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -11,6 +11,7 @@ jobs: env: DOCKER_ORG: heronfief + REPO_NAME: front ENDPOINT: git.legonzaur.fr steps: @@ -51,7 +52,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }} + images: ${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ env.REPO_NAME }} - name: Build and push uses: docker/build-push-action@v4 From da54495d1cd2a6968504ac9a1ac2526bb9beaabd Mon Sep 17 00:00:00 2001 From: legonzaur Date: Thu, 1 Aug 2024 08:12:50 +0000 Subject: [PATCH 2/3] Ci : add more tags --- .gitea/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6ef3e5b..5705908 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -53,6 +53,13 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ env.REPO_NAME }} + tags: | + type=schedule + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - name: Build and push uses: docker/build-push-action@v4 From 80f6d02fc7c417d3754ac709b513484c25c00c03 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Thu, 1 Aug 2024 10:44:09 +0000 Subject: [PATCH 3/3] Update .gitea/workflows/build.yml --- .gitea/workflows/build.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 5705908..104d57b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,8 +10,7 @@ jobs: runs-on: ubuntu-latest env: - DOCKER_ORG: heronfief - REPO_NAME: front + REPO_NAME: ${{ gitea.repository }} ENDPOINT: git.legonzaur.fr steps: @@ -21,12 +20,6 @@ jobs: lfs: false persist-credentials: false - - name: Get Meta - id: meta - run: | - echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT - - name: setup private key shell: bash run: | @@ -38,7 +31,7 @@ jobs: shell: bash run: | ssh-keyscan ${{ env.ENDPOINT }} >> ~/.ssh/known_hosts - git remote set-url origin git@${{ env.ENDPOINT }}:${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}.git + git remote set-url origin git@${{ env.ENDPOINT }}:${{ env.REPO_NAME }}.git git lfs pull - name: Login to DockerHub @@ -52,7 +45,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ env.REPO_NAME }} + images: ${{ env.ENDPOINT }}/${{ env.REPO_NAME }} tags: | type=schedule type=ref,event=branch @@ -66,9 +59,10 @@ jobs: with: context: . file: ./Dockerfile - secrets: | - "NUXT_PUBLIC_WEBSOCKET_ENDPOINT=${{ secrets.NUXT_PUBLIC_WEBSOCKET_ENDPOINT }}" - "NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=${{ secrets.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT }}" + build-args: | + NUXT_PUBLIC_ENDPOINT=${{ vars.NUXT_PUBLIC_ENDPOINT }} + NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=${{ vars.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT }} + NUXT_PUBLIC_WELCOME_MESSAGE=${{ vars.NUXT_PUBLIC_WELCOME_MESSAGE }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}