Update Dockerfile #5
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# - name: Build the Docker image | |
# run: docker build . --file Dockerfile --tag jfrog-exposures:$(date +%s) | |
- 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: demo.jfrog.io/docker-virtual/jfrog-docker-example:${{ github.run_number }} | |
run: | | |
jf docker build -t $IMAGE_NAME . | |
jf docker push $IMAGE_NAME | |
- name: Publish Build info With JFrog CLI | |
run: | | |
# Export the build name and build number | |
# 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 |