Skip to content

Create GitHub Actions CI #1

Create GitHub Actions CI

Create GitHub Actions CI #1

Workflow file for this run

name: Build & Publish Frontend
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create image name
id: image_name
run: echo "IMAGE_NAME=ghcr.io/$(echo "${{ github.repository }}-frontend" | tr '[:upper:]' '[:lower:]')" > "$GITHUB_ENV"
# create a unique tag for each build for debugging
- name: Set Docker tag
id: date
run: echo "DATE_STAMP=$(date +%s)" > "$GITHUB_ENV"
- name: Build and push Docker images
uses: iloveitaly/github-action-nixpacks@main
with:
context: './src/frontend'
push: true
tags: |
${{ env.IMAGE_NAME }}:sha-${{ env.DATE_STAMP }}
${{ env.IMAGE_NAME }}:latest