Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius committed Oct 30, 2023
1 parent 18825dc commit 8626bb5
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
build:
name: Compile and Test
runs-on: ubuntu-latest

permissions:
contents: write
packages: write
strategy:
matrix:
build-type: [Release, RelWithDebInfo]
Expand Down Expand Up @@ -81,6 +83,9 @@ jobs:
docker:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs: build
if: ${{ github.event_name != 'schedule' }}

Expand Down Expand Up @@ -109,18 +114,18 @@ jobs:
id: docker-vars
with:
image-name: ghcr.io/${{ github.repository }}/base
registry-secret: ${{ secrets.GHCR_PAT }}
registry-secret: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub
if: ${{ steps.docker-vars.outputs.has-docker-secret == 'true' }}
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ steps.docker-vars.outputs.docker-secret }}
password: ${{ steps.docker-vars.outputs.docker-secret }}

- name: Build and push
uses: docker/build-push-action@v2
Expand All @@ -133,8 +138,8 @@ jobs:
labels: |
org.opencontainers.image.title=${{ fromJson(steps.repo.outputs.result).name }}
org.opencontainers.image.description=${{ fromJson(steps.repo.outputs.result).description }}
org.opencontainers.image.url=${{ fromJson(steps.repo.outputs.result).homepage }}
org.opencontainers.image.source=${{ fromJson(steps.repo.outputs.result).html_url }}
org.opencontainers.image.url=${{ fromJson(steps.repo.outputs.result).html_url }}
org.opencontainers.image.source=${{ fromJson(steps.repo.outputs.result).clone_url }}
org.opencontainers.image.version=${{ steps.docker-vars.outputs.version }}
org.opencontainers.image.created=${{ steps.docker-vars.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
Expand Down

0 comments on commit 8626bb5

Please sign in to comment.