GitHub actions (#12) #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release and Attest" | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
create-release: | |
name: create-release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: insert newrelic key | |
run: sed -i "s|<LICENSE_KEY>|${{ secrets.NEWRELIC_LICENSE_KEY }}|g" newrelic.yml | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: codingdepot | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
tags: type=semver,pattern={{version}} | |
images: codingdepot/idp-target-registry | |
- name: Build and push | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | |
subject-digest: ${{ steps.push.outputs.digest }} | |
push-to-registry: true |