diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7ee466e..c2d50e1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,11 +2,8 @@ name: Build on: push: - branches: - - main - pull_request: - branches: - - main + tags: + - '*' jobs: build: @@ -29,26 +26,35 @@ jobs: runs-on: ubuntu-latest needs: build steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download war uses: actions/download-artifact@v4 with: name: war-file path: target + - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: List files in the repository - run: ls -la + + - name: Extract tag name + id: vars + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Build and push uses: docker/build-push-action@v5 with: push: true file: Dockerfile - tags: inseefr/magma-back-office:latest + tags: inseefr/magma-back-office:${{ env.TAG_NAME }}