-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (49 loc) · 1.66 KB
/
test-login-ocir-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sanity test login-ocir action
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test-action-home-region:
runs-on: ubuntu-latest
name: Sanity test login-ocir action
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 }}
steps:
- uses: actions/checkout@v4
- name: Retrieve the OCID of a named compartment in tenancy
uses: oracle-actions/[email protected]
id: find-compartment-id
with:
command: 'iam compartment list --compartment-id-in-subtree=true'
query: "data[?name=='github-actions'].id"
- name: Get or create an OCIR container repository
uses: oracle-actions/[email protected]
id: get-ocir-repository
with:
name: oraclelinux
compartment: ${{ steps.find-compartment-id.outputs.raw_output }}
- name: Log into OCIR
uses: ./
id: login-ocir
with:
auth_token: ${{ secrets.OCIR_TOKEN }}
- name: Tag and push a container image
id: tag-and-push-image
run: |
docker pull oraclelinux:8-slim
docker tag "oraclelinux:8-slim" "${{ steps.get-ocir-repository.outputs.repo_path }}:8-slim"
docker push "${{ steps.get-ocir-repository.outputs.repo_path }}:8-slim"