enable tls #36
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: build | |
on: | |
push: | |
branches: | |
- 'release/*' | |
tags: | |
- 'v*' | |
pull_request: | |
env: | |
DOCKERHUB_SLUG: goharbor/distribution | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.DOCKERHUB_SLUG }} | |
### versioning strategy | |
### push semver tag v2.9.0 on main (default branch) | |
# distribution/distribution:2.9.0 | |
# distribution/distribution:latest | |
### push semver tag v2.8.0 on release/2.8 branch | |
# distribution/distribution:2.8.0 | |
### push on main | |
# distribution/distribution:edge | |
tags: | | |
type=semver,pattern={{version}} | |
type=ref,event=pr | |
# don't create latest tag on release/2.x | |
flavor: | | |
latest=false | |
labels: | | |
org.opencontainers.image.title=Distribution | |
org.opencontainers.image.description=The toolkit to pack, ship, store, and deliver container content | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build artifacts | |
uses: docker/bake-action@v5 | |
with: | |
targets: artifact-all | |
- | |
name: Move artifacts | |
run: | | |
mv ./bin/**/* ./bin/ 2>/dev/null || true | |
- | |
name: Upload artifacts | |
uses: actions/upload-artifact@v4.3.6 | |
with: | |
name: registry | |
path: ./bin/* | |
if-no-files-found: error | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/#-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build image | |
uses: docker/bake-action@v5 | |
with: | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta.outputs.bake-file }} | |
targets: image-all | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
- | |
name: GitHub Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: | | |
bin/*.tar.gz | |
bin/*.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |