Skip to content

Instantly share code, notes, and snippets.

@recursivecodes
Created February 22, 2021 18:36
Show Gist options
  • Save recursivecodes/94ea6e8890d054f2160f8c01a0292c97 to your computer and use it in GitHub Desktop.
Save recursivecodes/94ea6e8890d054f2160f8c01a0292c97 to your computer and use it in GitHub Desktop.
build.yaml
- name: 'Checkout'
  uses: actions/checkout@v2
- name: 'Write Config & Key Files'
  run: |
    mkdir ~/.oci
    echo "[DEFAULT]" >> ~/.oci/config
    echo "user=${{secrets.OCI_USER_OCID}}" >> ~/.oci/config
    echo "fingerprint=${{secrets.OCI_FINGERPRINT}}" >> ~/.oci/config
    echo "pass_phrase=${{secrets.OCI_PASSPHRASE}}" >> ~/.oci/config
    echo "region=${{secrets.OCI_REGION}}" >> ~/.oci/config
    echo "tenancy=${{secrets.OCI_TENANCY_OCID}}" >> ~/.oci/config
    echo "key_file=~/.oci/key.pem" >> ~/.oci/config
    echo "${{secrets.OCI_KEY_FILE}}" >> ~/.oci/key.pem
- name: 'Install OCI CLI'
  run: |
    curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
    chmod +x install.sh
    ./install.sh --accept-all-defaults
    echo "/home/runner/bin" >> $GITHUB_PATH
    exec -l $SHELL
- name: 'Fix OCI Config File Permissions'
  run: |
    oci setup repair-file-permissions --file /home/runner/.oci/config
    oci setup repair-file-permissions --file /home/runner/.oci/key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment