Add .nvmrc #1348
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 | |
# This will run when: | |
# - when new code is pushed to main/staging to push the tags | |
# latest and develop | |
# - when a pull request is created and updated to make sure the | |
# Dockerfile is still valid. | |
# To be able to push to dockerhub, this execpts the following | |
# secrets to be set in the project: | |
# - DOCKERHUB_USERNAME : username that can push to the org | |
# - DOCKERHUB_PASSWORD : password asscoaited with the username | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
- expt | |
tags: | |
- "v*.*.*" | |
pull_request: | |
# Certain actions will only run when this is the main repo. | |
env: | |
MAIN_REPO: classtranscribe/FrontEnd | |
DOCKERHUB_ORG: classtranscribe | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# create metadata for image | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
${{ env.DOCKERHUB_ORG }}/frontend | |
ghcr.io/${{ github.repository_owner }}/frontend | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
# setup docker build | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Inspect Builder | |
run: | | |
echo "Name: ${{ steps.buildx.outputs.name }}" | |
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | |
echo "Status: ${{ steps.buildx.outputs.status }}" | |
echo "Flags: ${{ steps.buildx.outputs.flags }}" | |
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | |
# login to registries | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# build the docker images | |
- name: Build and push frontend | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
#push: ${{ github.event_name != 'pull_request' }} | |
push: true | |
platforms: "linux/amd64,linux/arm64" | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=classtranscribe/frontend-pipeline:buildcache | |
cache-to: type=registry,ref=classtranscribe/frontend:buildcache,mode=max | |
build-args: | | |
BRANCH=${{ steps.meta.outputs.version }} | |
BUILDNUMBER=${{ github.run_number }} | |
ARG GITSHA1=${{ github.sha }} |