Combine workflow files #45
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: Pipeline | ||
on: | ||
pull_request: | ||
push: | ||
branches: ["*"] | ||
jobs: | ||
check: | ||
name: Check formatting with Prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
- uses: oven-sh/setup-bun@v2 | ||
env: | ||
HUSKY: 0 | ||
- run: bun install --frozen-lockfile | ||
- uses: creyD/[email protected] | ||
with: | ||
prettier_options: --check . | ||
dry: true | ||
only_changed: true | ||
publish: | ||
name: Publish to Docker Hub | ||
runs-on: ubuntu-latest | ||
if: github.ref == "refs/heads/main" | ||
Check failure on line 34 in .github/workflows/pipeline.yaml GitHub Actions / PipelineInvalid workflow file
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
- name: Extract project metadata | ||
env: | ||
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }} | ||
run: | | ||
SEMVER=$(jq ".version" package.json | tr -d '"') | ||
declare -a versions=() | ||
IFS='.' read -ra versions <<< "$SEMVER" | ||
echo "SEMVER=$SEMVER" >> "$GITHUB_ENV" | ||
echo "MAJOR=${versions[0]}" >> "$GITHUB_ENV" | ||
echo "MINOR=${versions[1]}" >> "$GITHUB_ENV" | ||
echo "DEVELOPMENT=$GITHUB_REPOSITORY:development" >> "$GITHUB_ENV" | ||
echo "PRODUCTION=$GITHUB_REPOSITORY:production" >> "$GITHUB_ENV" | ||
- uses: docker/setup-buildx-action@v3 | ||
name: Setup Docker Buildx | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ vars.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
- name: Publish development tags | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: .devcontainer/ | ||
push: true | ||
tags: ${{ env.DEVELOPMENT }},${{ env.DEVELOPMENT }}-${{ env.MAJOR }},${{ env.DEVELOPMENT }}-${{ env.MAJOR }}.${{ env.MINOR }},${{ env.DEVELOPMENT }}-${{ env.SEMVER }} | ||
- name: Publish production tags | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.PRODUCTION }},${{ env.PRODUCTION }}-${{ env.MAJOR }},${{ env.PRODUCTION }}-${{ env.MAJOR }}.${{ env.MINOR }},${{ env.PRODUCTION }}-${{ env.SEMVER }} | ||