Skip to content

Commit

Permalink
oops, fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ellitedev committed Dec 4, 2023
1 parent e3c3e59 commit c6be3d5
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ jobs:
with:
push: true
tags: registry.ellite.dev/raibu-web:${{ steps.get_version.outputs.VERSION }}
- name: Get previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: '0.0.0'
- name: Check if tag is the latest
id: check_latest
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const tags = await github.repos.listTags({
owner: context.repo.owner,
repo: context.repo.repo,
});
const versions = tags.data.map(tag => tag.name).sort((a, b) => semver.rcompare(a, b));
return versions[0] === '${{ steps.get_version.outputs.VERSION }}';
run: |
echo ::set-output name=isLatest::$(if [[ "${{ steps.get_version.outputs.VERSION }}" > "${{ steps.previoustag.outputs.tag }}" ]]; then echo 'true'; else echo 'false'; fi)
- name: Build and push latest
if: steps.check_latest.outputs.result == 'true'
if: steps.check_latest.outputs.isLatest == 'true'
uses: docker/build-push-action@v5
with:
push: true
Expand Down

0 comments on commit c6be3d5

Please sign in to comment.