Skip to content

Commit

Permalink
Merge branch 'main' of github.com:libretexts/molview-lambda-api
Browse files Browse the repository at this point in the history
  • Loading branch information
bergwerf committed Sep 5, 2024
2 parents 902a59e + f989359 commit 2dbd798
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Docker Image

on:
workflow_dispatch:
inputs:
version:
description: 'Version to label the Docker image under'
required: true
type: string

jobs:
check_authorization:
name: Check authorization to publish new Docker image
runs-on: ubuntu-latest
outputs:
isAuthorized: ${{ steps.check-auth.outputs.is_authorized }}
steps:
- name: check-auth
id: check-auth
run: echo "is_authorized=${{ contains(secrets.DEPLOYMENT_AUTHORIZED_USERS, github.triggering_actor) }}" >> $GITHUB_OUTPUT
build:
name: Build Docker image
needs: check_authorization
if: needs.check_authorization.outputs.isAuthorized == 'true'
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/libretexts/molview-lambda-api:${{ inputs.version }}

0 comments on commit 2dbd798

Please sign in to comment.