ci: Added some checks to workflows #26
Workflow file for this run
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: Docker Build | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Setup Go environment | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
with: | ||
version: latest | ||
args: build --single-target --clean --output ./version | ||
env: | ||
GORELEASER_CURRENT_TAG: ${{ steps.draft_release.outputs.tag_name }} | ||
- name: Version test | ||
id: version | ||
run: echo "version=$(./version bump 0.1.0)" >> "$GITHUB_OUTPUT" | ||
- name: Failed | ||
if: ${{ steps.version.outputs.output != "0.1.1" }} | ||
Check failure on line 30 in .github/workflows/build.yaml GitHub Actions / Docker BuildInvalid workflow file
|
||
run: |- | ||
exit 1 | ||
- name: Success | ||
if: ${{ steps.version.outputs.output == "0.1.1" }} | ||
run: |- | ||
exit 0 | ||
docker-build: | ||
name: docker-build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | ||
- name: Build Docker image | ||
run: VERSION=$(git rev-parse --short HEAD) make docker-build | ||
- name: Version test | ||
id: version | ||
run: echo "version=$(docker run ghcr.io/version-cli/version:latest bump 0.1.0)" >> "$GITHUB_OUTPUT" | ||
- name: Failed | ||
if: ${{ steps.version.outputs.output != "0.1.1" }} | ||
run: |- | ||
exit 1 | ||
- name: Success | ||
if: ${{ steps.version.outputs.output == "0.1.1" }} | ||
run: |- | ||
exit 0 |