Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SAS-2735] Add semver release for major, minor and latest #1993

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,30 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: check if a version tag
- name: check if a version tag
id: check-version-tag
run: |
if [[ ${{ github.event.client_payload.tag }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
-
name: Sleep for 900s
- name: Sleep for 900s
if: steps.check-version-tag.outputs.match == 'true'
uses: juliangruber/sleep-action@v1
with:
time: 900s
-
name: check if a version tag in ref
- name: check if a version tag in ref
if: steps.check-version-tag.outputs.match == 'true'
id: get-version-tag-in-ref
run: |
if [[ ${{ github.event.client_payload.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=versiontag::$(echo "${{github.event.client_payload.ref}}" | cut -d / -f 3)
fi
-
name: Checkout
- name: Checkout
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
-
name: Docker meta
- name: Docker meta
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
id: meta
uses: docker/metadata-action@v4
Expand All @@ -45,27 +40,25 @@ jobs:
sodadata/soda-core
tags: |
type=raw,value=${{ github.event.client_payload.tag }}
-
name: Set up QEMU
type=semver,pattern=v{{major}}.{{minor}},value=${{ github.event.client_payload.tag }}
type=semver,pattern=v{{major}},value=${{ github.event.client_payload.tag }}
- name: Set up QEMU
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
- name: Login to DockerHub
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
if: github.event.client_payload.tag == steps.get-version-tag-in-ref.outputs.versiontag
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
Loading