Skip to content

Commit

Permalink
release workflow optiomization
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Oct 2, 2024
1 parent 681419f commit e80d663
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Development Pipeline
run: make dev-pipeline MULTIPLATFORM=true
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v2
Expand All @@ -38,6 +43,22 @@ jobs:
useConfigFile: true
configFilePath: ci/git-version.yml

- name: Build Docker image and export cache
uses: docker/build-push-action@v6
id: build-image
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: |
usabilitydynamics/udx-worker:${{ steps.gitversion.outputs.semVer }}
usabilitydynamics/udx-worker:latest
build-args: |
GIT_VERSION=${{ steps.gitversion.outputs.semVer }}
- name: Generate changelog
id: changelog
run: |
Expand Down Expand Up @@ -92,27 +113,23 @@ jobs:
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Docker image
- name: Push Docker image (cached)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=local,src=/tmp/.buildx-cache
tags: |
usabilitydynamics/udx-worker:${{ needs.test-pipeline.outputs.semVer }}
usabilitydynamics/udx-worker:latest
build-args: |
GIT_VERSION=${{ needs.test-pipeline.outputs.semVer }}
- name: Log out from Docker Hub
run: docker logout

0 comments on commit e80d663

Please sign in to comment.