Do not login locally #53
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 Images | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- feature/* | ||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Latest Version | ||
id: version | ||
run: | | ||
. ./.github/bin/reg-tags/image_api.sh | ||
_releases() { | ||
# Ask GH for the list of releases matching the tag pattern, then fool the sort | ||
# -V option to properly understand semantic versioning. Arrange for latest | ||
# version to be at the top. See: https://stackoverflow.com/a/40391207 | ||
github_releases -r 'v?[0-9]+\.[0-9]+\.[0-9]+' "$1" | | ||
sed '/-/!{s/$/_/}' | | ||
sort -Vr | | ||
sed 's/_$//' | ||
} | ||
version=$(_releases cloudflare/cloudflared | head -n 1) | ||
printf "version=%s\n" "$version" >> "$GITHUB_OUTPUT" | ||
# When pushing to the main branch, we (re)generate images, tagged with | ||
# "latest" | ||
ghcr: | ||
uses: ./.github/workflows/_build.yml | ||
Check failure on line 40 in .github/workflows/docker.yml
|
||
with: | ||
registry: ghcr.io | ||
platforms: linux/amd64,linux/arm64,linux/i386 | ||
secrets: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.ref_name == 'main' | ||
needs: version | ||
# When pushing to feature branches, we test stuff on the platform of the | ||
# runner only, using a local registry so as to be able to push and pull to | ||
# Docker from the builder steps. | ||
build: | ||
uses: ./.github/workflows/_build.yml | ||
with: | ||
registry: localhost:5000 | ||
platforms: linux/amd64 | ||
if: github.ref_name != 'main' | ||
needs: version |