Skip to content

Merge pull request #442 from idabblewith/main #248

Merge pull request #442 from idabblewith/main

Merge pull request #442 from idabblewith/main #248

Workflow file for this run

name: Docker Image CI for GHCR
on:
push:
tags:
- "*"
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker
run: docker login --username idabblewith --password ${{ secrets.GH_PAT }} ghcr.io
- name: Get the tag name
id: tag
run: echo "::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}"
- name: Build and Push Migration Image
env:
VITE_PRODUCTION_BASE_URL: "https://scienceprojects-migrated.dbca.wa.gov.au/"
VITE_PRODUCTION_BACKEND_API_URL: "https://scienceprojects-migrated.dbca.wa.gov.au/api/v1/"
VITE_PRODUCTION_PROFILES_BASE_URL: "https://profiles-migrated.dbca.wa.gov.au/"
VITE_SPMS_VERSION: ${{ steps.tag.outputs.TAG_NAME }}
run: |
docker build . --build-arg VITE_SPMS_VERSION=$VITE_SPMS_VERSION --build-arg VITE_PRODUCTION_PROFILES_BASE_URL=$VITE_PRODUCTION_PROFILES_BASE_URL --build-arg VITE_PRODUCTION_BASE_URL=$VITE_PRODUCTION_BASE_URL --build-arg VITE_PRODUCTION_BACKEND_API_URL=$VITE_PRODUCTION_BACKEND_API_URL --tag ghcr.io/dbca-wa/science-projects-client:migration
docker push ghcr.io/dbca-wa/science-projects-client:migration
- name: Build and Push Image
env:
VITE_PRODUCTION_BASE_URL: "https://scienceprojects.dbca.wa.gov.au/"
VITE_PRODUCTION_BACKEND_API_URL: "https://scienceprojects.dbca.wa.gov.au/api/v1/"
VITE_PRODUCTION_PROFILES_BASE_URL: "https://profiles.dbca.wa.gov.au/"
VITE_SPMS_VERSION: ${{ steps.tag.outputs.TAG_NAME }}
run: |
docker build . --build-arg VITE_SPMS_VERSION=$VITE_SPMS_VERSION --build-arg VITE_PRODUCTION_PROFILES_BASE_URL=$VITE_PRODUCTION_PROFILES_BASE_URL --build-arg VITE_PRODUCTION_BASE_URL=$VITE_PRODUCTION_BASE_URL --build-arg VITE_PRODUCTION_BACKEND_API_URL=$VITE_PRODUCTION_BACKEND_API_URL --tag ghcr.io/dbca-wa/science-projects-client:${{ steps.tag.outputs.TAG_NAME }}
docker push ghcr.io/dbca-wa/science-projects-client:${{ steps.tag.outputs.TAG_NAME }}
docker tag ghcr.io/dbca-wa/science-projects-client:${{ steps.tag.outputs.TAG_NAME }} ghcr.io/dbca-wa/science-projects-client:latest
docker push ghcr.io/dbca-wa/science-projects-client:latest
- name: Build and Push Test Image
env:
VITE_PRODUCTION_BASE_URL: "https://scienceprojects-test.dbca.wa.gov.au/"
VITE_PRODUCTION_BACKEND_API_URL: "https://scienceprojects-test.dbca.wa.gov.au/api/v1/"
VITE_PRODUCTION_PROFILES_BASE_URL: "https://profiles-test.dbca.wa.gov.au/"
VITE_SPMS_VERSION: ${{ steps.tag.outputs.TAG_NAME }}
run: |
docker build . --build-arg VITE_SPMS_VERSION=$VITE_SPMS_VERSION --build-arg VITE_PRODUCTION_PROFILES_BASE_URL=$VITE_PRODUCTION_PROFILES_BASE_URL --build-arg VITE_PRODUCTION_BASE_URL=$VITE_PRODUCTION_BASE_URL --build-arg VITE_PRODUCTION_BACKEND_API_URL=$VITE_PRODUCTION_BACKEND_API_URL --tag ghcr.io/dbca-wa/science-projects-client:test${{ steps.tag.outputs.TAG_NAME }}
docker push ghcr.io/dbca-wa/science-projects-client:test${{ steps.tag.outputs.TAG_NAME }}
docker tag ghcr.io/dbca-wa/science-projects-client:test${{ steps.tag.outputs.TAG_NAME }} ghcr.io/dbca-wa/science-projects-client:test
docker push ghcr.io/dbca-wa/science-projects-client:test