Skip to content

Update dependency org.jenkins-ci.plugins.workflow:workflow-job to v1295 [SECURITY] #407

Update dependency org.jenkins-ci.plugins.workflow:workflow-job to v1295 [SECURITY]

Update dependency org.jenkins-ci.plugins.workflow:workflow-job to v1295 [SECURITY] #407

name: GitHub CR Build and Push
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: [ master ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 1 * *'
env:
REGISTRY: ghcr.io
# IMAGE_NAME: ${{ github.repository }}
# github.repository as <account>/<repo>
jobs:
buildPush:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@b167a89702b8b5314c104ab9d211b3dcf774f2b1
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@f75d088332b07a08afadf6ac53c74509b9453f12
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Jenkins Docker metadata
id: meta
uses: docker/metadata-action@314ddf6d4a82333bf1bc7630399df41bf68eba09
with:
images: ${{ env.REGISTRY }}/${{ github.actor }}/jenkinsdsl
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and Push Jenkins image
id: build-and-push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Action to get the digest...
- name: GitOps Helm Chart Update(s)
uses: tpayne/github-actions/productmanifest@main
env:
API_TOKEN_GITHUB: ${{ secrets.XGITHUB_PAT }}
with:
gitops-repo-url: https://github.com/tpayne/codefresh-csdp-samples
manifest-file: helm/dev/values.yaml
github-username: ${{ secrets.XGITHUB_USER }}
github-email: ${{ secrets.XGITHUB_EMAIL }}
image-list: jenkinscd-framework-deployment:${{ env.REGISTRY }}/${{ github.actor }}/jenkinsdsl:master
git-token: ${{ secrets.XGITHUB_PAT }}
registry-server: ${{ env.REGISTRY }}
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.XGITHUB_PAT }}