mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 23:00:48 +08:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
a6b302e68a | |||
dd22eed198 | |||
3624aae550 | |||
f622e0b7fa | |||
dfea1166e1 | |||
4afc9248f1 | |||
f5c94acf91 | |||
2f7ba5802d |
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@ -19,6 +19,14 @@ jobs:
|
|||||||
docker-build-push-test:
|
docker-build-push-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@main
|
||||||
|
- uses: yanhao98/semantic-release-action@main
|
||||||
|
id: semantic
|
||||||
|
- name: Print the new release version
|
||||||
|
run: |
|
||||||
|
echo ${{ steps.semantic.outputs.next_release_published }}
|
||||||
|
echo ${{ steps.semantic.outputs.next_release_version }}
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@ -37,17 +45,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
build_file: ./docker-build-push/Dockerfile
|
build_file: ./docker-build-push/Dockerfile
|
||||||
build_platforms: linux/amd64
|
build_platforms: linux/amd64
|
||||||
build_push: ${{ github.ref == 'refs/heads/main' }}
|
build_push: ${{ github.ref_type == 'tag' }}
|
||||||
build_load: true
|
build_load: true
|
||||||
metadata_images: |
|
metadata_images: |
|
||||||
docker.io/${{ vars.DOCKERHUB_USERNAME }}/docker-example
|
docker.io/${{ vars.DOCKERHUB_USERNAME }}/docker-example
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}
|
||||||
metadata_tags: |
|
metadata_tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=semver,pattern={{version}}
|
||||||
type=ref,event=tag,enable=true,priority=600
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{major}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=semver,pattern={{major}}
|
|
||||||
- name: Check Docker image
|
- name: Check Docker image
|
||||||
run: |
|
run: |
|
||||||
set -x;
|
set -x;
|
||||||
|
7
.releaserc.json
Normal file
7
.releaserc.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
"@semantic-release/changelog"
|
||||||
|
]
|
||||||
|
}
|
@ -33,7 +33,19 @@ outputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check .git folder
|
||||||
|
id: check-git-folder
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -d .git ]; then
|
||||||
|
echo "Found .git folder"
|
||||||
|
echo "git-folder-exists=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "No .git folder found"
|
||||||
|
echo "git-folder-exists=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
|
if: steps.check-git-folder.outputs.git-folder-exists == 'false'
|
||||||
with:
|
with:
|
||||||
filter: blob:none
|
filter: blob:none
|
||||||
show-progress: false
|
show-progress: false
|
||||||
@ -42,7 +54,7 @@ runs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5 # https://github.com/docker/metadata-action
|
uses: docker/metadata-action@v5 # https://github.com/docker/metadata-action
|
||||||
with:
|
with:
|
||||||
context: git
|
# context: git
|
||||||
# flavor
|
# flavor
|
||||||
images: ${{ inputs.metadata_images }}
|
images: ${{ inputs.metadata_images }}
|
||||||
tags: ${{ inputs.metadata_tags }}
|
tags: ${{ inputs.metadata_tags }}
|
||||||
|
Reference in New Issue
Block a user