Skip to content

Merge pull request #22 from golang-cz/features #27

Merge pull request #22 from golang-cz/features

Merge pull request #22 from golang-cz/features #27

Workflow file for this run

name: CI
on:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
uses: ./.github/workflows/checks.yml # use the callable tests job to run tests

Check failure on line 15 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

error parsing called workflow ".github/workflows/ci.yml" -> "./.github/workflows/checks.yml" (source branch with sha:d3572e2e0279dc009f38c0e81e6f0b893664fc30) : workflow is not reusable as it is missing a `on.workflow_call` trigger
docker-build:
needs: [tests]
runs-on: ubuntu-latest
env:
BUILDER_IMAGE: golang:1.21-alpine3.18
steps:
- name: Git clone
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout Pull Request HEAD commit instead of the default Pull Request merge commit.
- name: Log into Github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Docker build
run: |
PULL_REQUEST_ID=${{ github.event.number }}
export COMMIT="$(git log -1 --pretty=format:'%h')"
export VERSION="$(date -d @$(git log -n1 --format=%at) +'v%-y.%-m.%-d')-${COMMIT}${PULL_REQUEST_ID:+-PR-$PULL_REQUEST_ID}"
docker build --build-arg BUILDER_IMAGE=${BUILDER_IMAGE} --build-arg VERSION=${VERSION} --build-arg COMMIT=${COMMIT} -t ghcr.io/skeleton:$VERSION .
docker push ghcr.io/skeleton:$VERSION