Skip to content

Update environments #21

Update environments

Update environments #21

name: Dev - Build & Push docker images
on:
push:
branches: [ "dev" ]
paths-ignore:
- '.github/**'
- '.gitignore'
- 'database/**'
- 'documentation/**'
- 'openshift/**'
- 'tests/**'
- 'CODE_OF_CONDUCT.md'
- 'COMPLIANCE.yaml'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'SECURITY..md'
env:
CLUSTER: https://api.silver.devops.gov.bc.ca:6443
AUTH_TOKEN: ${{ secrets.OPENSHIFT_TOKEN_DEV }}
TARGET_PROJECT: ${{ vars.PROJECT_NAMESPACE }}
TARGET_ENV: ${{ env.NAME }}

Check failure on line 24 in .github/workflows/docker-build-dev.yml

View workflow run for this annotation

GitHub Actions / Dev - Build & Push docker images

Invalid workflow file

The workflow is not valid. .github/workflows/docker-build-dev.yml (Line: 24, Col: 15): Unrecognized named-value: 'env'. Located at position 1 within expression: env.NAME
jobs:
build:
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v3
- name: Build application Docker images
run: docker compose build
working-directory: ./applications
- name: Connect to OpenShift API
run: |
oc login --token=$AUTH_TOKEN --server=$CLUSTER
oc project $TARGET_PROJECT-$TARGET_ENV
oc registry login
- name: Push application images to OpenShift container registry
run: |
docker tag webapp image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/webapp:github-latest
docker push image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/webapp:github-latest