Skip to content

Commit

Permalink
Merge pull request #493 from GeorgeWalker/support-develop
Browse files Browse the repository at this point in the history
updated landing page
  • Loading branch information
GeorgeWalker authored Jul 22, 2024
2 parents 5ff31ab + 56ec0fa commit e92edb4
Show file tree
Hide file tree
Showing 5 changed files with 1,758 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/cd-dfa-landing-page-support-prod-nomessage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#CD pipeline for dfa landing page into the support stream
name: cd-dfa-landing-page-support-prod-nomessage

on:
workflow_dispatch:

env:
IMAGE_NAME: dfa-landing-page
WORKING_DIRECTORY: ./landing-page/src

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v3

- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

- name: Log into registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_SUPPORT_REGISTRY }}
username: ${{ secrets.DOCKER_SUPPORT_USERNAME }}
password: ${{ secrets.DOCKER_SUPPORT_PASSWORD_BUILDER }}

- name: Set image repository
id: set_image_repository
run: |
# Set image repository and change all uppercase to lowercase
DOCKER_REPOSITORY=$(echo ${{ secrets.DOCKER_SUPPORT_REGISTRY }}/${{ env.IMAGE_NAME }} | tr '[A-Z]' '[a-z]')
echo "::set-output name=docker-repository::$DOCKER_REPOSITORY"
- name: Pull image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
run: docker pull $DOCKER_REPOSITORY:latest || true

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ${{ env.IMAGE_NAME }}=v
fetch_all_tags: true

- name: Build image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | awk -F=v '{print $NF}')
echo DOCKER_REPOSITORY=${{ env.DOCKER_REPOSITORY }}
echo VERSION=$VERSION


tar -czh . | docker build --load --tag ${{ env.DOCKER_REPOSITORY }}:latest --cache-from=${{ env.DOCKER_REPOSITORY }}:latest --build-arg VERSION=$VERSION -
docker tag ${{ env.DOCKER_REPOSITORY }}:latest ${{ env.DOCKER_REPOSITORY }}:$VERSION

- name: Push image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
run: |
docker push --all-tags ${{ env.DOCKER_REPOSITORY }}
70 changes: 70 additions & 0 deletions .github/workflows/cd-dfa-landing-page-support-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#CD pipeline for dfa landing page into the support stream
name: cd-dfa-landing-page-support-prod

on:
workflow_dispatch:

env:
IMAGE_NAME: dfa-landing-page
WORKING_DIRECTORY: ./landing-page/src

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v3

- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true

- name: Log into registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_SUPPORT_REGISTRY }}
username: ${{ secrets.DOCKER_SUPPORT_USERNAME }}
password: ${{ secrets.DOCKER_SUPPORT_PASSWORD_BUILDER }}

- name: Set image repository
id: set_image_repository
run: |
# Set image repository and change all uppercase to lowercase
DOCKER_REPOSITORY=$(echo ${{ secrets.DOCKER_SUPPORT_REGISTRY }}/${{ env.IMAGE_NAME }} | tr '[A-Z]' '[a-z]')
echo "::set-output name=docker-repository::$DOCKER_REPOSITORY"
- name: Pull image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
run: docker pull $DOCKER_REPOSITORY:latest || true

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ${{ env.IMAGE_NAME }}=v
fetch_all_tags: true

- name: Build image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
VERSION=$(echo "${{ steps.tag_version.outputs.new_tag }}" | awk -F=v '{print $NF}')
echo DOCKER_REPOSITORY=${{ env.DOCKER_REPOSITORY }}
echo VERSION=$VERSION

copy html/index.prod html/index.html

tar -czh . | docker build --load --tag ${{ env.DOCKER_REPOSITORY }}:prod --build-arg VERSION=$VERSION -
docker tag ${{ env.DOCKER_REPOSITORY }}:prod ${{ env.DOCKER_REPOSITORY }}:$VERSION

- name: Push image
env:
DOCKER_REPOSITORY: ${{ steps.set_image_repository.outputs.docker-repository }}
run: |
docker push --all-tags ${{ env.DOCKER_REPOSITORY }}
2 changes: 1 addition & 1 deletion .github/workflows/cd-dfa-landing-page-support-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#CD pipeline for dfa landing page into the support stream
name: cd-dfa-landing-page-support
name: cd-dfa-landing-page-support-test

on:
workflow_dispatch:
Expand Down
Loading

0 comments on commit e92edb4

Please sign in to comment.