Use env for ci ghcr_image since vars is not accessible in PRs
This commit is contained in:
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@@ -10,6 +10,9 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
GHCR_IMAGE: donkie/spoolman
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
#
|
#
|
||||||
# Linting
|
# Linting
|
||||||
@@ -128,10 +131,10 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6.7.0
|
uses: docker/build-push-action@v6.7.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
tags: ${{ vars.GHCR_IMAGE }}:test
|
tags: ${{ env.GHCR_IMAGE }}:test
|
||||||
outputs: type=docker,dest=/tmp/spoolman.tar
|
outputs: type=docker,dest=/tmp/spoolman.tar
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-amd64
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-amd64
|
||||||
cache-to: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-amd64,mode=max
|
cache-to: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-amd64,mode=max
|
||||||
|
|
||||||
# Separate build for pull requests since PRs dont have access to store cache
|
# Separate build for pull requests since PRs dont have access to store cache
|
||||||
- name: Build Spoolman (PR)
|
- name: Build Spoolman (PR)
|
||||||
@@ -139,9 +142,9 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6.7.0
|
uses: docker/build-push-action@v6.7.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
tags: ${{ vars.GHCR_IMAGE }}:test
|
tags: ${{ env.GHCR_IMAGE }}:test
|
||||||
outputs: type=docker,dest=/tmp/spoolman.tar
|
outputs: type=docker,dest=/tmp/spoolman.tar
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-amd64
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-amd64
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4.4.0
|
uses: actions/upload-artifact@v4.4.0
|
||||||
@@ -172,10 +175,10 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6.7.0
|
uses: docker/build-push-action@v6.7.0
|
||||||
with:
|
with:
|
||||||
context: ./tests_integration
|
context: ./tests_integration
|
||||||
tags: ${{ vars.GHCR_IMAGE }}-tester:latest
|
tags: ${{ env.GHCR_IMAGE }}-tester:latest
|
||||||
outputs: type=docker,dest=/tmp/spoolman-tester.tar
|
outputs: type=docker,dest=/tmp/spoolman-tester.tar
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-tester
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-tester
|
||||||
cache-to: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-tester,mode=max
|
cache-to: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-tester,mode=max
|
||||||
|
|
||||||
# Separate build for pull requests since PRs dont have access to store cache
|
# Separate build for pull requests since PRs dont have access to store cache
|
||||||
- name: Build Spoolman Tester (PR)
|
- name: Build Spoolman Tester (PR)
|
||||||
@@ -183,9 +186,9 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6.7.0
|
uses: docker/build-push-action@v6.7.0
|
||||||
with:
|
with:
|
||||||
context: ./tests_integration
|
context: ./tests_integration
|
||||||
tags: ${{ vars.GHCR_IMAGE }}-tester:latest
|
tags: ${{ env.GHCR_IMAGE }}-tester:latest
|
||||||
outputs: type=docker,dest=/tmp/spoolman-tester.tar
|
outputs: type=docker,dest=/tmp/spoolman-tester.tar
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-tester
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-tester
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4.4.0
|
uses: actions/upload-artifact@v4.4.0
|
||||||
@@ -259,8 +262,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-arm64
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-arm64
|
||||||
cache-to: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-arm64,mode=max
|
cache-to: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-arm64,mode=max
|
||||||
#
|
#
|
||||||
# Build arm/v7 image
|
# Build arm/v7 image
|
||||||
# Don't run this for pull requests
|
# Don't run this for pull requests
|
||||||
@@ -298,8 +301,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/arm/v7
|
platforms: linux/arm/v7
|
||||||
cache-from: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-armv7
|
cache-from: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-armv7
|
||||||
cache-to: type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-armv7,mode=max
|
cache-to: type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-armv7,mode=max
|
||||||
#
|
#
|
||||||
# Release images GHCR and Docker Hub if tests pass
|
# Release images GHCR and Docker Hub if tests pass
|
||||||
# Don't run this for pull requests
|
# Don't run this for pull requests
|
||||||
@@ -336,7 +339,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5.5.1
|
uses: docker/metadata-action@v5.5.1
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
ghcr.io/${{ vars.GHCR_IMAGE }}
|
ghcr.io/${{ env.GHCR_IMAGE }}
|
||||||
tags: |
|
tags: |
|
||||||
type=edge
|
type=edge
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
@@ -381,9 +384,9 @@ jobs:
|
|||||||
GIT_COMMIT
|
GIT_COMMIT
|
||||||
BUILD_DATE
|
BUILD_DATE
|
||||||
cache-from: |
|
cache-from: |
|
||||||
type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-amd64
|
type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-amd64
|
||||||
type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-arm64
|
type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-arm64
|
||||||
type=registry,ref=ghcr.io/${{ vars.GHCR_IMAGE }}:buildcache-armv7
|
type=registry,ref=ghcr.io/${{ env.GHCR_IMAGE }}:buildcache-armv7
|
||||||
#
|
#
|
||||||
# Create Github Release if CI was triggered by a tag
|
# Create Github Release if CI was triggered by a tag
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user