chore: Improve tagging of images and applying labels
This commit is contained in:
parent
0b5e7599f8
commit
83d654d3a2
5 changed files with 101 additions and 72 deletions
17
.github/workflows/build-pr.yml
vendored
17
.github/workflows/build-pr.yml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
export: ${{ steps.build.outputs.export }}
|
||||
push: ${{ steps.build.outputs.push }}
|
||||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
run: |
|
||||
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
|
||||
earthly org s blue-build
|
||||
earthly sat s blue-build-pr
|
||||
earthly sat s pr
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
@ -53,10 +53,11 @@ jobs:
|
|||
id: build
|
||||
run: |
|
||||
if [ -n "${{ github.token }}" ]; then
|
||||
earthly --ci --push +build-scripts
|
||||
echo "export=true" >> "$GITHUB_OUTPUT"
|
||||
earthly --ci --push +build
|
||||
echo "push=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
earthly --ci +build
|
||||
fi
|
||||
earthly --ci +build
|
||||
|
||||
integration-tests:
|
||||
permissions:
|
||||
|
|
@ -65,7 +66,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
if: needs.build.outputs.export == 'true'
|
||||
if: needs.build.outputs.push == 'true'
|
||||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
|
|
@ -104,7 +105,7 @@ jobs:
|
|||
id-token: write
|
||||
needs:
|
||||
- build
|
||||
if: needs.build.outputs.export == 'true'
|
||||
if: needs.build.outputs.push == 'true'
|
||||
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
|
|
@ -125,7 +126,7 @@ jobs:
|
|||
run: |
|
||||
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
|
||||
earthly org s blue-build
|
||||
earthly sat s blue-build-pr
|
||||
earthly sat s pr
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
|
|||
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
run: |
|
||||
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
|
||||
earthly org s blue-build
|
||||
earthly sat s blue-build-main
|
||||
earthly sat s main
|
||||
|
||||
# Setup repo and add caching
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -124,7 +124,7 @@ jobs:
|
|||
run: |
|
||||
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
|
||||
earthly org s blue-build
|
||||
earthly sat s blue-build-main
|
||||
earthly sat s main
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
|
|||
4
.github/workflows/tag.yml
vendored
4
.github/workflows/tag.yml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
run: |
|
||||
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
|
||||
earthly org s blue-build
|
||||
earthly sat s blue-build-tag
|
||||
earthly sat s tag
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
|
|
@ -42,4 +42,4 @@ jobs:
|
|||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
CARGO_PACKAGE_VERSION="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "blue-build") .version')"
|
||||
LATEST=$(test "$CARGO_PACKAGE_VERSION" = "$LATEST_TAG" && echo true || echo false)
|
||||
earthly --push --ci -P +all --TAG=$LATEST_TAG --LATEST=$LATEST
|
||||
earthly --push --ci -P +all --TAGGED="true" --LATEST="$LATEST"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue