Scheduled build and push of all images #5
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
# This workflow will run every first of the month, to make sure we update the underlying images and libraries | |
name: Scheduled build and push of all images | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
rebuild-scheduled: | |
name: Rebuild images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build frontend image, using cache from Github registry | |
uses: docker/build-push-action@v6 | |
with: | |
context: frontend/. | |
file: Dockerfile.base | |
push: true | |
tags: ghcr.io/centrefordigitalhumanities/ianalyzer-frontend:latest | |
cache-from: type=registry,ref=ghcr.io/centrefordigitalhumanities/ianalyzer-frontend:latest | |
cache-to: type=inline | |
- name: Build backend image, using cache from Github registry | |
uses: docker/build-push-action@v6 | |
with: | |
context: backend/. | |
file: Dockerfile.base | |
push: true | |
tags: ghcr.io/centrefordigitalhumanities/ianalyzer-backend:latest | |
cache-from: type=registry,ref=ghcr.io/centrefordigitalhumanities/ianalyzer-backend:latest | |
cache-to: type=inline | |
- name: Build Elasticsearch image, using cache from Github registry | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: DockerfileElastic | |
push: true | |
tags: ghcr.io/centrefordigitalhumanities/ianalyzer-elasticsearch:latest | |
cache-from: type=registry,ref=ghcr.io/centrefordigitalhumanities/ianalyzer-elasticsearch:latest | |
cache-to: type=inline |