diff --git a/.github/workflows/push-image.yaml b/.github/workflows/push-image.yaml index 50a9028..e605e7a 100644 --- a/.github/workflows/push-image.yaml +++ b/.github/workflows/push-image.yaml @@ -5,35 +5,44 @@ on: tags: - 'v*' jobs: - Patch: + build-and-push: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 with: - fetch-depth: '0' - - - name: Set safe git dir - run : | - git config --global --add safe.directory /github/workspace + fetch-depth: 0 - - name: Minor version for each merge - id: dryrun - uses: anothrNick/github-tag-action@1.36.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true - DRY_RUN: true - - - name: Show new Tag - run: | - echo "The next tag version will be: ${{ steps.dryrun.outputs.new_tag }}" - - name: Show Part + - name: Get latest tag run: | - echo "The version increment was: ${{ steps.dryrun.outputs.part }}" + latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + echo "Latest tag is $latest_tag" + echo "::set-output name=latest_tag::$latest_tag" - - name: Tag repository - id: tagRepo - uses: anothrNick/github-tag-action@1.36.0 - env: + - name: Determine new version + id: semver + uses: anothrNick/github-tag-action@1.20.0 + with: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} WITH_V: true + + - 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: Build and push latest + uses: docker/build-push-action@v5 + with: + push: true + tags: giovannidegiorgio/sons-of-the-docker:latest + - name: Build and push tag + uses: docker/build-push-action@v5 + with: + push: true + tags: giovannidegiorgio/sons-of-the-docker:latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e9c4503..2230f31 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,20 +6,37 @@ on: - main jobs: - build-and-push: + Patch: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: - fetch-depth: 0 + fetch-depth: '0' - - name: Determine new version - id: semver - uses: anothrNick/github-tag-action@1.20.0 - with: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Set safe git dir + run : | + git config --global --add safe.directory /github/workspace + + - name: Minor version for each merge + id: dryrun + uses: anothrNick/github-tag-action@1.36.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true DRY_RUN: true + - name: Show new Tag + run: | + echo "The next tag version will be: ${{ steps.dryrun.outputs.new_tag }}" + - name: Show Part + run: | + echo "The version increment was: ${{ steps.dryrun.outputs.part }}" + + - name: Tag repository + id: tagRepo + uses: anothrNick/github-tag-action@1.36.0 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + WITH_V: true + +