-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding GitHub workflows to generate container images (#235)
* Adding GitHub workflows to generate container images for app * Updating Flourish references to SparkHacks in README. --------- Co-authored-by: Chase 李 <chase@emiya.io>
- Loading branch information
Showing
3 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: Container Build Merge | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout Repository 🛎️ | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx 🐳 | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Container Registry 🪪 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for container 📤 | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Use Node 20.x 🔧 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
- name: Install App Build Dependencies 📃 | ||
run: | | ||
npm ci | ||
- name: Build App 🛠️ | ||
run: | | ||
npm run build | ||
- name: Build and push container 🚢 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Container Build PR | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout Repository 🛎️ | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Extract metadata (tags, labels) for container 📤 | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Use Node 20.x 🔧 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
- name: Install App Build Dependencies 📃 | ||
run: | | ||
npm ci | ||
- name: Build App 🛠️ | ||
run: | | ||
npm run build | ||
- name: Build container 📦 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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