Update environments #21
This file contains 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
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 GitHub Actions / Dev - Build & Push docker imagesInvalid workflow file
|
||
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 | ||