Skip to content

TMP: build Docker image from source #13

TMP: build Docker image from source

TMP: build Docker image from source #13

Workflow file for this run

name: Release
on:
push:
# tags:
# - "v*.*.*"
# paths-ignore:
# - "**.md"
# - "docs/**"
# - "docsrc/**"
branches:
- "gardena/eb/docker_test"
jobs:
# pypi:
# runs-on: ubuntu-latest
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
# with:
# egress-policy: audit
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Publish GH release
# uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
# with:
# generate_release_notes: true
# - name: Build using Poetry and publish to PyPI
# uses: JRubics/poetry-publish@7100bd02517e9f82452e6247849042f6c74dde04 # v2.0
# with:
# pypi_token: ${{ secrets.PYPI_API_KEY }}
docker:
#needs: pypi
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
# - name: Set GOOSEBIT_VERSION env var
# run: |
# if [ $GITHUB_REF_TYPE = tag ]; then
# tag=$GITHUB_REF_NAME
# else
# tag=v0.2.3 # TODO: fail instead
# fi
# echo "GOOSEBIT_VERSION=${tag#v}" >> $GITHUB_ENV
# - name: Wait for PyPI package to become available
# run: |
# while [ "$(curl -Ss https://pypi.org/pypi/goosebit/json |
# jq ".releases | has(\"$GOOSEBIT_VERSION\")")" != "true" ]
# do
# sleep 1
# done
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Log in to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: upstreamdata/goosebit
- name: Build and push Docker image
id: push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: .
file: docker/dev.dockerfile
#build-args: GOOSEBIT_VERSION=${{ env.GOOSEBIT_VERSION }}
push: true
provenance: mode=max
sbom: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}