Skip to content

build(node): delete .node-version #105

build(node): delete .node-version

build(node): delete .node-version #105

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: Homebrew/actions/setup-homebrew@master
- uses: actions/setup-go@v5
with:
go-version: "^1.20.0"
- name: Install linters
run: |
brew install \
actionlint \
hadolint \
shellcheck
# - name: Install actionlint
# uses: jaxxstorm/action-install-gh-release@v1.10.0
# with:
# repo: rhysd/actionlint
# - name: Install hadolint
# uses: jaxxstorm/action-install-gh-release@v1.10.0
# with:
# repo: hadolint/hadolint
# extension-matching: disable
# rename-to: hadolint
# chmod: 0755
# shellcheck uses a .xz compression so it's incompatible
# - name: Install shellcheck
# uses: jaxxstorm/action-install-gh-release@v1.10.0
# with:
# repo: koalaman/shellcheck
# - name: Install shellcheck
# run: sudo apt-get install shellcheck
# golangci-lint zips their binary directly without a parent directory
# - name: Install golangci-lint
# uses: jaxxstorm/action-install-gh-release@v1.10.0
# with:
# repo: golangci/golangci-lint
# - name: Install golangci-lint
# run: go install github.com/golangci/golangci-lint@latest
- name: Install golangci-lint
# ref: https://golangci-lint.run/usage/install/#other-ci
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.55.2
- uses: pre-commit/action@release
docker-build-and-push:
name: Build and push
runs-on: ubuntu-latest
needs: [lint]
steps:
# Not needed since build-push-action will clone
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: open-turo/actions-release/semantic-release@v4
id: semantic-release
with:
github-token: ${{ secrets.GHA_TOKEN }}
dry-run: true
- name: Set release version
id: set-release-version
run: |
version="${{ steps.semantic-release.outputs.new-release-version }}"
if [[ -n "$version" ]]; then
echo "New version: $version"
echo "release-version=$version" >> "$GITHUB_OUTPUT"
else
echo "No new version"
echo "release-version=latest" >> "$GITHUB_OUTPUT"
fi
- uses: docker/build-push-action@v5
with:
build-args: GITHUB_TOKEN=${{ secrets.GHA_TOKEN }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:build-${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
${{ github.repository }}:${{ steps.set-release-version.outputs.release-version }}