Skip to content

Merge pull request #384 from Call-for-Code-for-Racial-Justice/dependa… #23

Merge pull request #384 from Call-for-Code-for-Racial-Justice/dependa…

Merge pull request #384 from Call-for-Code-for-Racial-Justice/dependa… #23

# This is a basic workflow to help you get started with Actions
name: IBM Cloud Code Engine Deploy
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
# Runs a single command using the runners shell
- name: Install IBM Cloud CLI
run: curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
- name: Install Code Engine plugin
run: |
ibmcloud plugin install code-engine
ibmcloud plugin install container-registry
- name: Show IBM CLI version
run: ibmcloud -v
- name: Login to IBM Cloud
env:
IBM_CLOUD_APIKEY: ${{ secrets.BLUE_IBM_CLOUD_API_KEY }}
IBM_CLOUD_GROUP: ${{ secrets.BLUE_RESOURCE_GROUP }}
run: |
ibmcloud login --apikey $IBM_CLOUD_APIKEY -g $IBM_CLOUD_GROUP -r us-south
ibmcloud cr login
# Runs a set of commands using the runners shell
- name: Build and deploy
run: |
IMAGE_TAG=$(date '+%FT%H%M%S')
docker build -t us.icr.io/fivefifthsvoter/fivefifthsvoter-next:$IMAGE_TAG .
docker push us.icr.io/fivefifthsvoter/fivefifthsvoter-next:$IMAGE_TAG
ibmcloud ce project select --name fivefifthsvoter
ibmcloud ce app logs --tail 5 --follow --name fivefifthsvoter &
ibmcloud ce app update --image private.us.icr.io/fivefifthsvoter/fivefifthsvoter-next:$IMAGE_TAG --name fivefifthsvoter