diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 4b183e2..2e69ac9 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -28,57 +28,3 @@ jobs: dry: true only_changed: true - publish: - name: Publish to Docker Hub - needs: check - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' && endsWith(github.repository, '-boilerplate') - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Extract project metadata - env: - AUTHOR: ${{ vars.DOCKER_HUB_USERNAME }} - GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }} - run: | - SEMVER=$(jq ".version" package.json | tr -d '"') - - declare -a versions=() - declare -a split_by_slash=() - - IFS='.' read -ra versions <<< "$SEMVER" - IFS="/" read -ra split_by_slash <<< "$GITHUB_REPOSITORY" - - echo "SEMVER=$SEMVER" >> "$GITHUB_ENV" - echo "MAJOR=${versions[0]}" >> "$GITHUB_ENV" - echo "MINOR=${versions[1]}" >> "$GITHUB_ENV" - echo "AUTHOR=${AUTHOR:-${split_by_slash[0]}}" >> "$GITHUB_ENV" - echo "DEVELOPMENT=$GITHUB_REPOSITORY:development" >> "$GITHUB_ENV" - echo "PRODUCTION=$GITHUB_REPOSITORY:production" >> "$GITHUB_ENV" - - - uses: docker/setup-buildx-action@v3 - name: Setup Docker Buildx - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ env.AUTHOR }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - - - name: Publish development tags - uses: docker/build-push-action@v6 - with: - context: .devcontainer/ - push: true - tags: ${{ env.DEVELOPMENT }},${{ env.DEVELOPMENT }}-${{ env.MAJOR }},${{ env.DEVELOPMENT }}-${{ env.MAJOR }}.${{ env.MINOR }},${{ env.DEVELOPMENT }}-${{ env.SEMVER }} - - - name: Publish production tags - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ env.PRODUCTION }},${{ env.PRODUCTION }}-${{ env.MAJOR }},${{ env.PRODUCTION }}-${{ env.MAJOR }}.${{ env.MINOR }},${{ env.PRODUCTION }}-${{ env.SEMVER }}