Always run even if paths didn't change #2
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: 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 |