Skip to content

applicreation/versions-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

versions-action

Usage

on:
  release:
    types:
      - published
jobs:
  release:
    runs-on: ubuntu-latest
    steps:  
      - uses: applicreation/versions-action@v1
        id: versions
      - run: echo ${{ steps.versions.outputs.patch }}
      - run: echo ${{ steps.versions.outputs.minor }}
      - run: echo ${{ steps.versions.outputs.major }}

Example

---

name: Docker release
on:
  release:
    types:
      - published
jobs:
  docker-release:
    name: Build and push
    runs-on: ubuntu-latest
    steps:
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to GitHub Container registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Get versions
        uses: applicreation/versions-action@v1
        id: versions
      - name: Build and push
        uses: docker/build-push-action@v3
        with:
          push: true
          tags: |
            ghcr.io/${{ github.repository }}:${{ steps.versions.outputs.patch }}
            ghcr.io/${{ github.repository }}:${{ steps.versions.outputs.minor }}
            ghcr.io/${{ github.repository }}:${{ steps.versions.outputs.major }}
            ghcr.io/${{ github.repository }}:latest