Files
caperren-com/.gitea/workflows/build.yaml
Corwin Perren 5544a08add
Some checks failed
Build and Test / determine_version (push) Successful in 41s
Build and Test / build_and_push (push) Failing after 13s
Build and Test / test (push) Successful in 1s
Improved tagging
2025-03-08 00:32:52 -08:00

64 lines
2.4 KiB
YAML

name: Build and Test
#run-name: ${{ gitea.actor }} is triggered a new
on:
push:
branches: [main]
# pull_request:
# branches: [main]
jobs:
determine_version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node Environment
uses: actions/setup-node@v4
- name: Acquire Project Metadata
id: project_metadata
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
echo PROJECT_VERSION=$(npm pkg get version --workspaces=false | tr -d \") >> $GITHUB_OUTPUT
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: gitea.perren.cloud
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
gitea.perren.cloud/caperren/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.project_metadata.outputs.REPO_VERSION_HASH }}
gitea.perren.cloud/caperren/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.project_metadata.outputs.PROJECT_VERSION }}
gitea.perren.cloud/caperren/caperren-com:latest
test:
runs-on: ubuntu-latest
steps:
- run: echo "Tests would go here"
# - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
# - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
# - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
# - name: Check out repository code
# uses: actions/checkout@v4
# - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
# - run: echo "🖥️ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ gitea.workspace }}
# - run: echo "🍏 This job's status is ${{ job.status }}."