Merge pull request #226 from jonrau1/cis-bm-aws2 #13
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: "ElectricEye on OCI Container Registry" | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
ElectricEyeOnOcrPublic: | |
runs-on: ubuntu-latest | |
# All 5 of these OCI_ tags must match exactly | |
# https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clienvironmentvariables.htm | |
env: | |
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }} | |
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }} | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }} | |
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }} | |
IMAGE_TAG: ${{ github.sha }} | |
steps: | |
# Checkout le branch | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Get OCR Repo Information | |
- name: Get OCR Repository | |
uses: oracle-actions/[email protected] | |
id: get-ocir-repository | |
with: | |
name: electriceye | |
compartment: ${{ secrets.OCI_COMPARTMENT_OCID }} | |
# Log into OCR with AuthKey | |
- name: OCR Login | |
uses: oracle-actions/[email protected] | |
id: login-ocir | |
with: | |
auth_token: ${{ secrets.OCR_AUTHKEY }} | |
# Build, Tag, Push to OCR | |
- name: Build, Tag, Push Image to OCR | |
id: tag-and-push-image | |
run: | | |
docker build -t ${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG . | |
docker tag ${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG ${{ steps.get-ocir-repository.outputs.repo_path }}:latest | |
docker push ${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG | |
docker push ${{ steps.get-ocir-repository.outputs.repo_path }}:latest | |
# Print the location | |
- name: Print Image | |
run: echo "${{ steps.get-ocir-repository.outputs.repo_path }}:$IMAGE_TAG" |