Skip to content

Merge jobs: use context property to read reference name. #6

Merge jobs: use context property to read reference name.

Merge jobs: use context property to read reference name. #6

Workflow file for this run

name: Build on Push
on:
push:
branches-ignore:
- main
jobs:
build_and_publish_container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine container name
run: |
branch="$(sed -e 's#refs/heads/##' <<<"${{ github.rev }}")"
echo "SLUG='collectd/ci:${branch:?}'" >>"${GITHUB_ENV}"
- name: Build container
run: docker build --pull -t "${SLUG:?}" .
- run: docker inspect "${SLUG:?}"
- run: docker history "${SLUG:?}"
- run: docker images
- name: Log into the container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- run: docker push "${SLUG:?}"