mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed automatic builds with docker container
This commit is contained in:
parent
990baea47c
commit
a1b26e68ae
3 changed files with 24 additions and 50 deletions
48
.github/workflows/build-container.yml
vendored
48
.github/workflows/build-container.yml
vendored
|
|
@ -1,48 +0,0 @@
|
|||
name: build and publish containers
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
jobs:
|
||||
build-magellan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check out the repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
# list of Docker images to use as base name for tags
|
||||
images: |
|
||||
ghcr.io/openchami/magellan
|
||||
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern=v{{version}}
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
type=sha
|
||||
- name: setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to github container repo
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push magellan
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
|
|
@ -11,8 +11,6 @@ permissions: write-all # Necessary for the generate-build-provenance action with
|
|||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
|
@ -20,6 +18,12 @@ jobs:
|
|||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.21
|
||||
- name: Docker Login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry :ghcr.io
|
||||
username: ${{ gihub.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -25,6 +25,24 @@ archives:
|
|||
- CHANGELOG.md
|
||||
- README.md
|
||||
- bin/magellan.sh
|
||||
dockers:
|
||||
-
|
||||
image_templates:
|
||||
- ghcr.io/openchami/{{.ProjectName}}:latest
|
||||
- ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}
|
||||
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}
|
||||
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.title={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CHANGELOG.md
|
||||
- README.md
|
||||
- bin/magellan.sh
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
snapshot:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue