aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2022-03-26 17:51:34 -0400
committerGitHub <[email protected]>2022-03-26 16:51:34 -0500
commit986b055e1195dba200f4b295ad3c32ae53f3ec75 (patch)
tree53a7e0733fc7f4fa84b760bc4c1e6b912bf86fda /.github/workflows
parent297228692c7f692f059d7988d76c56578626e9fb (diff)
downloadmuse-986b055e1195dba200f4b295ad3c32ae53f3ec75.tar.xz
muse-986b055e1195dba200f4b295ad3c32ae53f3ec75.zip
Add args during build (#607)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/pr.yml9
-rw-r--r--.github/workflows/publish.yml9
2 files changed, 18 insertions, 0 deletions
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index c96dfb2..a1066c9 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -23,6 +23,8 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
+ # AWS data transfer is pricy
+ if: ${{ matrix.runner-platform != 'self-hosted' }}
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
@@ -40,6 +42,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
+ - name: Get current time
+ uses: josStorer/get-current-time@v2
+ id: current-time
+
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
@@ -50,6 +56,9 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=min
platforms: ${{ matrix.build-arch }}
+ build-args: |
+ COMMIT_HASH=${{ github.sha }}
+ BUILD_DATE=${{ steps.current-time.outputs.time }}
combine-and-comment:
name: Combine platform tags and leave comment
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index d3fed5e..58df795 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -25,6 +25,8 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
+ # AWS data transfer is pricy
+ if: ${{ matrix.runner-platform != 'self-hosted' }}
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
@@ -38,6 +40,10 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Get current time
+ uses: josStorer/get-current-time@v2
+ id: current-time
+
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
@@ -47,6 +53,9 @@ jobs:
platforms: ${{ matrix.build-arch }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=min
+ build-args: |
+ COMMIT_HASH=${{ github.sha }}
+ BUILD_DATE=${{ steps.current-time.outputs.time }}
combine:
name: Combine platform tags