Skip to content

Commit

Permalink
wip: Build release image in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Jan 24, 2025
1 parent 93ef508 commit 9dab830
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "v*.*.*"
branches:
- master
- fix-release-builds
# Do not run the workflow if the project hasn't changed.
# NOTE: It will run on every tag push, but only if the `paths` filter is satisfied on the chosen `branches`
# (source: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore).
Expand Down Expand Up @@ -43,11 +44,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ship-docker-image:
environment: build-ship
# environment: build-ship
runs-on: ubuntu-latest

permissions:
packages: write
# permissions:
# packages: write

steps:
- name: Checkout code
Expand All @@ -69,18 +70,18 @@ jobs:
type=semver,pattern={{major}}
type=edge
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Log in to the container registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -93,14 +94,13 @@ jobs:
with:
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
push: true
push: ${{ github.ref == 'refs/heads/master' }}
platforms: |
linux/amd64
linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
CARGO_PROFILE=${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'staging' }}
VERSION=${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.version'] }}
VERSION=${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.version'] || 'unknown' }}
COMMIT=${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.revision'] }}
BUILD_TIMESTAMP=${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.created'] }}

0 comments on commit 9dab830

Please sign in to comment.