Skip to content

Commit 06819da

Browse files
committed
Refactor OCI deployment to use direct CLI commands.
Replaced `oracle-actions/run-oci-cli-command` with direct OCI CLI usage for improved flexibility and control. Added steps to install and configure OCI CLI within the workflow.
1 parent cab0fe7 commit 06819da

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/deploy-to-oci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@ jobs:
3939
push: true
4040
tags: ${{ secrets.OCI_REGISTRY }}/${{ secrets.OCI_REPOSITORY }}:${{ github.sha }}
4141

42+
- name: Set up OCI CLI
43+
run: |
44+
pip install oci-cli
45+
mkdir -p ~/.oci
46+
echo "${{ secrets.OCI_CONFIG }}" > ~/.oci/config
47+
echo "${{ secrets.OCI_KEY }}" > ~/.oci/key.pem
48+
chmod 600 ~/.oci/key.pem
49+
chmod 600 ~/.oci/config
50+
4251
- name: Deploy to Container Instances
43-
uses: oracle-actions/run-oci-cli-command@v1
44-
with:
45-
command: container-instances create-container-instance
46-
args: |
47-
--compartment-id ${{ secrets.OCI_COMPARTMENT_ID }}
48-
--availability-domain ${{ secrets.OCI_AVAILABILITY_DOMAIN }}
49-
--shape ${{ secrets.OCI_SHAPE }}
50-
--display-name my-app
52+
run: |
53+
oci container-instances create-container-instance \
54+
--compartment-id ${{ secrets.OCI_COMPARTMENT_ID }} \
55+
--availability-domain ${{ secrets.OCI_AVAILABILITY_DOMAIN }} \
56+
--shape ${{ secrets.OCI_SHAPE }} \
57+
--display-name my-app \
5158
--container-config '[{"image":"${{ secrets.OCI_REGISTRY }}/${{ secrets.OCI_REPOSITORY }}:${{ github.sha }}"}]'

0 commit comments

Comments
 (0)