Docker Image CI #1762
Workflow file for this run
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: Docker Image CI | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-and-push-app: | |
# This only makes sense to run for pastvu owned repo. | |
if: github.repository_owner == 'pastvu' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.19.0 | |
- name: Build | |
run: | | |
npm ci | |
npm run build | |
- name: Sentry | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: | | |
npm run sentry:sourcemaps | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Build backend | |
- name: Backend metadata | |
id: docker_meta_backend | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/pastvu/backend/en | |
- name: Build and push backend | |
id: docker_build_backend | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./.docker/backend.Dockerfile | |
tags: ${{ steps.docker_meta_backend.outputs.tags }} | |
labels: ${{ steps.docker_meta_backend.outputs.labels }} | |
push: true | |
# Build frontend | |
- name: Frontend Metadata | |
id: docker_meta_frontend | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/pastvu/frontend/en | |
- name: Build and push frontend | |
id: docker_build_frontend | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./.docker/frontend.Dockerfile | |
tags: ${{ steps.docker_meta_frontend.outputs.tags }} | |
labels: ${{ steps.docker_meta_frontend.outputs.labels }} | |
push: true | |
- name: Image digest | |
run: | | |
echo ${{ steps.docker_build_backend.outputs.digest }} | |
echo ${{ steps.docker_build_frontend.outputs.digest }} |