feat: add voting information for Arizona, Washington, Nevada, Oregon,… #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deploy cloud - IBM Code Engine | |
| name: IBM Cloud - Deploy to Staging site | |
| permissions: | |
| contents: read | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on push for the main branch | |
| push: | |
| branches: [main] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| # Build & deploy | |
| build: | |
| runs-on: ubuntu-latest | |
| 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-file: "./app/.nvmrc" | |
| - 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: | |
| IBMCLOUD_API_KEY: ${{ secrets.BLUE_IBM_CLOUD_API_KEY }} | |
| IBM_CLOUD_GROUP: ${{ secrets.BLUE_RESOURCE_GROUP }} | |
| IBM_REGION: ${{ vars.IBM_REGION }} | |
| IBM_CR_REGION: ${{ vars.IBM_CR_REGION }} | |
| run: | | |
| ibmcloud login -g ${IBM_CLOUD_GROUP} -r ${IBM_REGION} | |
| ibmcloud cr region-set ${IBM_CR_REGION} | |
| ibmcloud cr login | |
| - name: Updating staging site | |
| env: | |
| CE_PROJECT: ${{ vars.CE_PROJECT }} | |
| CE_APP_NAME: ${{ vars.CE_APP_NAME }} | |
| CE_SCALE_DOWN_DELAY: ${{ vars.CE_SCALE_DOWN_DELAY }} | |
| CR_IMAGE: ${{ vars.CR_IMAGE }} | |
| run: | | |
| IMAGE_TAG=$(date '+%FT%H%M%S') | |
| docker build -t ${CR_IMAGE}:$IMAGE_TAG . | |
| docker push ${CR_IMAGE}:$IMAGE_TAG | |
| ibmcloud ce project select --name ${CE_PROJECT} | |
| ibmcloud ce app logs --tail 5 --follow --name ${CE_APP_NAME} & | |
| ibmcloud ce app update --image private.${CR_IMAGE}:$IMAGE_TAG --scale-down-delay ${CE_SCALE_DOWN_DELAY} --name ${CE_APP_NAME} | |
| echo "### Staging site updated :rocket:" >> $GITHUB_STEP_SUMMARY | |
| echo "Staging is now using image ${CR_IMAGE}:$IMAGE_TAG" >> $GITHUB_STEP_SUMMARY | |