diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd86240..3f2d64e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,42 +1,33 @@ name: Go package on: - push: - tags: - - "v*" # push events to tagged commits - branches: - - "**" + workflow_dispatch: permissions: contents: read id-token: write # for GitHub id-token auth jobs: - push-docker: - if: startsWith(github.ref, 'refs/tags/v') # only run this step on tagged commits + make-images: + name: Make Docker Images and Push To Registry + if: github.ref == 'refs/heads/defang' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: defang - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up QEMU (for multi-arch builds) - uses: docker/setup-qemu-action@v3 - - - name: Build and push Docker images and manifests - working-directory: src - run: make push-images ${{ startsWith(github.ref, 'refs/tags/v') && format('VERSION={0}', github.ref_name) || '' }} - + - name: Login to Docker Hub + run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin + - name: Push Docker images + run: make push on-failure: runs-on: ubuntu-latest if: failure() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) - needs: [push-docker] + needs: [make-images] steps: - name: Slack Notification uses: rtCamp/action-slack-notify@v2