Fixed automatic builds with docker container

This commit is contained in:
David Allen 2024-08-21 10:09:21 -06:00
parent 990baea47c
commit a1b26e68ae
Signed by: towk
GPG key ID: 793B2924A49B3A3F
3 changed files with 24 additions and 50 deletions

View file

@ -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 }}

View file

@ -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: