Trigger on `gh-v*.*.*' tags only
This commit is contained in:
		
							parent
							
								
									db65b6aed2
								
							
						
					
					
						commit
						0f6d044167
					
				|  | @ -2,11 +2,8 @@ name: ci | ||||||
| 
 | 
 | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches: |  | ||||||
|       - '**' |  | ||||||
|     tags: |     tags: | ||||||
|       - 'v*.*.*' |       - 'gh-v*.*.*' | ||||||
|   pull_request: |  | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   docker: |   docker: | ||||||
|  | @ -21,7 +18,7 @@ jobs: | ||||||
|         run: | |         run: | | ||||||
|           if [[ $GITHUB_REF == refs/tags/* ]]; then |           if [[ $GITHUB_REF == refs/tags/* ]]; then | ||||||
|             VERSION=${GITHUB_REF#refs/tags/} |             VERSION=${GITHUB_REF#refs/tags/} | ||||||
|             if [[ $VERSION =~ ^v([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$ ]]; then |             if [[ $VERSION =~ ^gh-v([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$ ]]; then | ||||||
|                MAJOR="${BASH_REMATCH[1]}" |                MAJOR="${BASH_REMATCH[1]}" | ||||||
|                MINOR="${BASH_REMATCH[2]}" |                MINOR="${BASH_REMATCH[2]}" | ||||||
|                PATCH="${BASH_REMATCH[3]}" |                PATCH="${BASH_REMATCH[3]}" | ||||||
|  |  | ||||||
|  | @ -182,11 +182,7 @@ spec: | ||||||
| 
 | 
 | ||||||
| # Build and publish with GitHub Actions | # Build and publish with GitHub Actions | ||||||
| 
 | 
 | ||||||
| In a forked repository you can use GitHub Actions pipeline defined in [.github/workflows/release.yml](.github/workflows/release.yml). The pipeline builds Docker images for `linux/amd64`, `linux/arm64`, and `linux/arm/v7` platforms and publishes them using a multi-arch manifest attaching tags according to the next rules: | In a forked repository you can use GitHub Actions pipeline defined in [.github/workflows/release.yml](.github/workflows/release.yml). The pipeline builds Docker images for `linux/amd64`, `linux/arm64`, and `linux/arm/v7` platforms and publishes them using a multi-arch manifest. The pipeline is triggered when you add a tag like `gh-v{major}.{minor}.{patch}` to your commit and push it to GitHub. The tag is used for generating Docker image tags: `latest`, `{major}`, `{major}:{minor}`, `{major}:{minor}:{patch}`. | ||||||
| * For the master branch, it uses `:edge` tag and pushes images to the registry. |  | ||||||
| * For any other branch except master, it uses the branch name as the tag name replacing `/`s with `-`s, and pushes to the registry. |  | ||||||
| * For any tag matching patter `v{major}.{minor}.{patch}` it creates several tags: `latest`, `{major}`, `{major}:{minor}`, `{major}:{minor}:{patch}` and pushes to the registry. For any other tag, it uses the tag's name as the image tag and pushes too. |  | ||||||
| * For pull requests, it uses ephemeral `:pr-{github.event.number}` tags, builds the images but doesn't push to the registry. |  | ||||||
| 
 | 
 | ||||||
| The pipeline adds several labels: | The pipeline adds several labels: | ||||||
| * `org.opencontainers.image.title=${{ github.event.repository.name }}` | * `org.opencontainers.image.title=${{ github.event.repository.name }}` | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue