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

Optimize Release Workflow [UAT-52] #56

Merged
merged 2 commits into from
Oct 24, 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
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
driver: docker-container

- name: Prepare Docker cache directory
run: mkdir -p /tmp/.buildx-cache
run: mkdir -p /tmp/.buildx-cache

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-
${{ runner.os }}-buildx-

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v2
Expand All @@ -49,18 +49,17 @@ jobs:
configFilePath: ci/git-version.yml

- name: Multi-arch build
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: false
cache-from: type=inline
cache-to: type=inline
cache-to: type=inline,mode=max
tags: |
usabilitydynamics/udx-worker:${{ steps.gitversion.outputs.semVer }}
build-args: |
GIT_VERSION=${{ steps.gitversion.outputs.semVer }}

- name: Generate changelog
id: changelog
Expand Down Expand Up @@ -95,10 +94,9 @@ jobs:
git push origin ${{ needs.test-pipeline.outputs.semVer }}

- name: Create GitHub release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.test-pipeline.outputs.semVer }}
release_name: ${{ needs.test-pipeline.outputs.semVer }}
body: ${{ needs.test-pipeline.outputs.changelog }}
draft: false
prerelease: false
Expand Down Expand Up @@ -127,15 +125,14 @@ jobs:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Release the image
- name: Push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=inline
cache-to: type=inline
cache-from: type=inline,mode=max
tags: |
usabilitydynamics/udx-worker:${{ needs.test-pipeline.outputs.semVer }}
usabilitydynamics/udx-worker:latest
Expand Down
Loading