Skip to content

updated object storage output #42

updated object storage output

updated object storage output #42

Workflow file for this run

name: Supremo CICD
on:
push:
branches:
- main
jobs:
build_supremo_app:
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 }}
REACT_APP_BACKEND_SERVICE_IP: ${{ vars.BACKEND_IP }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get or create an OCIR Repository
uses: oracle-actions/[email protected]
id: get-ocir-repository
with:
name: frontend/supremo-reactjs-${{ github.repository_id }}
compartment: ${{ secrets.OCI_COMPARTMENT_OCID }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.get-ocir-repository.outputs.repo_path }}
tags: |
type=sha,prefix=
- name: Login to OCI Container Registry
uses: oracle-actions/[email protected]
id: login-ocir
with:
auth_token: ${{ secrets.OCI_AUTH_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
working-directory: frontend
run: npm list
- name: Install dependencies
working-directory: frontend
run: npm install
- name: Build supremo app
working-directory: frontend
run: CI=false npm run build
- name: Build and push image
id: build
uses: docker/build-push-action@v5
with:
context: frontend/.
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
deploy_app:
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 }}
runs-on: ubuntu-latest
needs:
- build_supremo_app
steps:
- name: Get or create an OCIR Repository
uses: oracle-actions/[email protected]
id: get-ocir-repository
with:
name: frontend/supremo-reactjs-${{ github.repository_id }}
compartment: ${{ secrets.OCI_COMPARTMENT_OCID }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.get-ocir-repository.outputs.repo_path }}
tags: |
type=sha,prefix=
- name: Deploy via OCI DevOps Deployment Pipeline
uses: oracle-actions/[email protected]
with:
command: devops deployment create-pipeline-deployment --pipeline-id ${{ secrets.OCI_DEVOPS_PIPELINE_ID }} --deployment-arguments "{\"items\":[{\"name\":\"IMG\",\"value\":\"${{ steps.get-ocir-repository.outputs.repo_path }}:${{ steps.meta.outputs.version }}\"}]}"
silent: true