Skip to content

Handle request event #97

Handle request event

Handle request event #97

---
name: Build and Push Docker Images
on: push
# push:
# branches:
# - main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.WRITE_PACKAGE_TOKEN }}
- name: Build and push frontend Docker image
id: frontend_build
uses: docker/build-push-action@v6
with:
file: ./container/frontend.dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend:${{ github.sha }}
# - name: Build and push scigateway Docker image
# uses: docker/build-push-action@v6
# id: scigateway_build
# with:
# context: ./container
# file: ./container/scigateway.dockerfile
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/scigateway:${{ github.sha }}
# - name: Checkout the Gitops repository
# uses: actions/checkout@v4
# with:
# repository: fiaisis/gitops
# token: ${{ secrets.GITOPS_STAGING_EDIT_TOKEN }}
#
# - name: Edit the YAML frontend file for staging
# uses: mikefarah/[email protected]
# with:
# cmd: yq e -i '.spec.template.spec.containers[] |= select(.name == "frontend").image = "ghcr.io/fiaisis/frontend@${{ steps.frontend_build.outputs.digest }}"' './components/frontend/envs/staging/frontend.yml'
#
# # - name: Edit the YAML scigateway file for staging
# # uses: mikefarah/[email protected]
# # with:
# # cmd: yq e -i '.spec.template.spec.containers[] |= select(.name == "scigateway").image = "ghcr.io/fiaisis/scigateway@${{ steps.scigateway_build.outputs.digest }}"' './components/scigateway/envs/staging/scigateway.yml'
#
# - name: Commit and push changes
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git commit -am "[CD] Update frontend with this commit ${{ github.event.head_commit.url}}"
# git push