mirror of
https://github.com/2martens/tsw-timetable.git
synced 2026-10-17 16:06:51 +02:00
change: Push to ghcr.io
This commit is contained in:
@@ -38,21 +38,21 @@ jobs:
|
|||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: gradle -Prelease.useLastTag=true final jib
|
run: gradle -Prelease.useLastTag=true final jib
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
USERNAME: ${{ github.actor }}
|
||||||
PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
|
PASSWORD: ${{ GITHUB_TOKEN }}
|
||||||
- name: Create and publish docker image
|
- name: Create and publish docker image
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: gradle snapshot jib
|
run: gradle snapshot jib
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
USERNAME: ${{ github.actor }}
|
||||||
PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
|
PASSWORD: ${{ GITHUB_TOKEN }}
|
||||||
- name: Extract Jib digest
|
- name: Extract Jib digest
|
||||||
id: digest
|
id: digest
|
||||||
run: |
|
run: |
|
||||||
DIGEST_FILE=${{ github.workspace }}/module-deploy/build/jib-image.digest
|
DIGEST_FILE=${{ github.workspace }}/module-deploy/build/jib-image.digest
|
||||||
INDEX_DIGEST=$(cat $DIGEST_FILE)
|
INDEX_DIGEST=$(cat $DIGEST_FILE)
|
||||||
echo "digest=$INDEX_DIGEST" >> $GITHUB_OUTPUT
|
echo "digest=$INDEX_DIGEST" >> $GITHUB_OUTPUT
|
||||||
ARCH_DIGESTS=$(docker manifest inspect 2martens/timetable@$INDEX_DIGEST | jq -r '.manifests[].digest')
|
ARCH_DIGESTS=$(docker manifest inspect ghcr.io/2martens/timetable@$INDEX_DIGEST | jq -r '.manifests[].digest')
|
||||||
n=0
|
n=0
|
||||||
for d in $ARCH_DIGESTS; do
|
for d in $ARCH_DIGESTS; do
|
||||||
echo "arch${n}=$d" >> $GITHUB_OUTPUT
|
echo "arch${n}=$d" >> $GITHUB_OUTPUT
|
||||||
@@ -61,23 +61,28 @@ jobs:
|
|||||||
- name: Perform docker login
|
- name: Perform docker login
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: docker.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
password: ${{ GITHUB_TOKEN }}
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/2martens/timetable
|
||||||
- uses: anchore/sbom-action@v0
|
- uses: anchore/sbom-action@v0
|
||||||
with:
|
with:
|
||||||
image: docker.io/2martens/timetable
|
image: ghcr.io/2martens/timetable
|
||||||
output-file: sbom.json
|
output-file: sbom.json
|
||||||
- name: Attest
|
- name: Attest
|
||||||
uses: actions/attest-build-provenance@v3
|
uses: actions/attest-build-provenance@v3
|
||||||
with:
|
with:
|
||||||
subject-name: index.docker.io/2martens/timetable
|
subject-name: ghcr.io/2martens/timetable
|
||||||
subject-digest: ${{ steps.digest.outputs.digest }}
|
subject-digest: ${{ steps.digest.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
- name: Generate SBOM attestation
|
- name: Generate SBOM attestation
|
||||||
uses: actions/attest-sbom@v2
|
uses: actions/attest-sbom@v2
|
||||||
with:
|
with:
|
||||||
subject-name: index.docker.io/2martens/timetable
|
subject-name: ghcr.io/2martens/timetable
|
||||||
subject-digest: ${{ steps.digest.outputs.digest }}
|
subject-digest: ${{ steps.digest.outputs.digest }}
|
||||||
sbom-path: 'sbom.json'
|
sbom-path: 'sbom.json'
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
@@ -21,7 +21,7 @@ jib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
image = "2martens/timetable"
|
image = "ghcr.io/2martens/timetable"
|
||||||
tags = setOf(
|
tags = setOf(
|
||||||
"latest",
|
"latest",
|
||||||
properties["version"].toString().replace("+", "-"))
|
properties["version"].toString().replace("+", "-"))
|
||||||
|
|||||||
Reference in New Issue
Block a user