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: Build and Tag Docker Image | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup JFrog CLI | |
uses: jfrog/setup-jfrog-cli@v3 | |
env: | |
JF_URL: ${{ secrets.JF_URL }} | |
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} | |
- name: Build Tag and push Docker Image | |
env: | |
IMAGE_NAME: rni.jfrog.io/digit-docker-remote/ubuntu:22.04 | |
BUILD_NAME: rni.jfrog.io/digit-cd/ghrunners:latest | |
run: | | |
jf docker pull $IMAGE_NAME | |
jf docker build -t $BUILD_NAME . | |
jf docker push $BUILD_NAME | |
- name: Scan Docker Image | |
env: | |
BUILD_NAME: rni.jfrog.io/digit-cd/ghrunners:latest | |
run: jf docker scan $BUILD_NAME | |
- name: Publish Build info With JFrog CLI | |
env: | |
# Generated and maintained by GitHub | |
JFROG_CLI_BUILD_NAME: jfrog-docker-build-example | |
# JFrog organization secret | |
JFROG_CLI_BUILD_NUMBER : ${{ github.run_number }} | |
run: | | |
# Export the build name and build nuber | |
# Collect environment variables for the build | |
jf rt build-collect-env | |
# Collect VCS details from git and add them to the build | |
jf rt build-add-git | |
# Publish build info | |
jf rt build-publish |