Skip to content

Commit

Permalink
Publish to docker.io/rancher
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Apr 12, 2024
1 parent 0aa56c1 commit d94b1f3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/release-fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
permissions:
contents: write
packages: write
id-token: write # this is important, it's how we authenticate with Vault

env:
GOARCH: amd64
Expand All @@ -18,6 +19,7 @@ env:
jobs:
build-fleet:
runs-on: ubuntu-latest
if: github.repository == 'rancher/fleet'
steps:
- name: Check out Fleet
uses: actions/checkout@v4
Expand All @@ -38,6 +40,13 @@ jobs:
version: v1.55
args: --timeout=10m --config=.golangci.json

- name: "Read Vault Secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
- name: Run FOSSA scan
if: contains(github.ref, 'rc') != true
uses: fossas/[email protected]
Expand Down Expand Up @@ -71,12 +80,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into Container registry
- name: Log into Docker Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand All @@ -91,7 +99,7 @@ jobs:
- name: Upload charts to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo: "ghcr.io/rancher"
repo: "docker.io/rancher"
run: |
version=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.version')
tag=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.tag')
Expand Down
20 changes: 10 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ dockers:

# Templates of the Docker image names.
image_templates:
- "ghcr.io/rancher/fleet:{{ .Tag }}-linux-amd64"
- "docker.io/rancher/fleet:{{ .Tag }}-linux-amd64"

# Path to the Dockerfile (from the project root).
dockerfile: package/Dockerfile
Expand All @@ -160,7 +160,7 @@ dockers:
- fleet-gitcloner
- fleet-gitjob
image_templates:
- "ghcr.io/rancher/fleet:{{ .Tag }}-linux-arm64"
- "docker.io/rancher/fleet:{{ .Tag }}-linux-arm64"
dockerfile: package/Dockerfile
build_flag_templates:
- "--pull"
Expand All @@ -181,7 +181,7 @@ dockers:
ids:
- fleet-agent
image_templates:
- "ghcr.io/rancher/fleet-agent:{{ .Tag }}-linux-amd64"
- "docker.io/rancher/fleet-agent:{{ .Tag }}-linux-amd64"
dockerfile: package/Dockerfile.agent
build_flag_templates:
- "--pull"
Expand All @@ -200,7 +200,7 @@ dockers:
ids:
- fleet-agent
image_templates:
- "ghcr.io/rancher/fleet-agent:{{ .Tag }}-linux-arm64"
- "docker.io/rancher/fleet-agent:{{ .Tag }}-linux-arm64"
dockerfile: package/Dockerfile.agent
build_flag_templates:
- "--pull"
Expand All @@ -215,12 +215,12 @@ dockers:

docker_manifests:
# https://goreleaser.com/customization/docker_manifest/
- name_template: "ghcr.io/rancher/fleet:{{ .Tag }}"
- name_template: "docker.io/rancher/fleet:{{ .Tag }}"
image_templates:
- "ghcr.io/rancher/fleet:{{ .Tag }}-linux-amd64"
- "ghcr.io/rancher/fleet:{{ .Tag }}-linux-arm64"
- "docker.io/rancher/fleet:{{ .Tag }}-linux-amd64"
- "docker.io/rancher/fleet:{{ .Tag }}-linux-arm64"

- name_template: "ghcr.io/rancher/fleet-agent:{{ .Tag }}"
- name_template: "docker.io/rancher/fleet-agent:{{ .Tag }}"
image_templates:
- "ghcr.io/rancher/fleet-agent:{{ .Tag }}-linux-amd64"
- "ghcr.io/rancher/fleet-agent:{{ .Tag }}-linux-arm64"
- "docker.io/rancher/fleet-agent:{{ .Tag }}-linux-amd64"
- "docker.io/rancher/fleet-agent:{{ .Tag }}-linux-arm64"

0 comments on commit d94b1f3

Please sign in to comment.