Fix overall feedback date range that was left in from testing #103
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: Create and publish a Docker image | |
on: | |
pull_request_target: | |
types: | |
- closed | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
REPO_NAME: ${{ github.repository }} | |
jobs: | |
cache-deps: | |
if: github.event.pull_request.merged == true | |
name: Pull request merge - Validate npm cache for main branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout [main] | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.15.0 | |
- name: Use the node_modules cache if available [npm] | |
id: use-npm-cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-18.15.0-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
if: steps.use-npm-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
build-and-push-image: | |
if: github.event.pull_request.merged == true | |
needs: cache-deps | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push Docker image (web) | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: docker/performance_base/Dockerfile | |
target: web | |
push: true | |
tags: ghcr.io/${{ env.REPO_NAME }}/web:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build and push Docker image (nginx) | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: docker/performance_base/Dockerfile | |
target: nginx | |
push: true | |
tags: ghcr.io/${{ env.REPO_NAME }}/nginx:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Build and push Docker image (db-updater) | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: docker/performance_base/Dockerfile | |
target: db-updater | |
push: true | |
tags: ghcr.io/${{ env.REPO_NAME }}/db-updater:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |