diff --git a/.github/workflows/docker-ghcr.yml b/.github/workflows/docker-ghcr.yml index d98a566..ca38b9f 100644 --- a/.github/workflows/docker-ghcr.yml +++ b/.github/workflows/docker-ghcr.yml @@ -6,25 +6,18 @@ name: Publish Docker Image on GHCR - GitHub Container Registry # documentation. on: -# schedule: -# - cron: '24 21 * * *' push: - branches: [ "rising" ] tags: [ 'v*.*.*' ] - pull_request: - branches: [ "rising" ] env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} IMAGE_BASE_NAME: fluidos-energy-predictor - ORG_NAME: risingfbk - BASE_BRANCH: rising - + ORG_NAME: ${{ github.repository_owner }} + BASE_BRANCH: ${{ github.ref }} jobs: build: - runs-on: ubuntu-latest permissions: contents: read @@ -88,22 +81,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - - - # Sign the resulting Docker image digest except on PRs. - # This will only write to the public Rekor transparency log when the Docker - # repository is public to avoid leaking data. If you would like to publish - # transparency data even for private images, pass --force to cosign below. - # https://github.com/sigstore/cosign - # - name: Sign the published Docker image - # if: ${{ github.event_name != 'pull_request' }} - # env: - # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - # TAGS: ${{ steps.meta.outputs.tags }} - #DIGEST: ${{ steps.build-and-push.outputs.digest }} - # This step uses the identity token to provision an ephemeral certificate - # against the sigstore community Fulcio instance. - #run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} + platforms: linux/amd64,linux/arm64 clean: name: Clean up unused images diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 616f329..ac43cd0 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -14,12 +14,17 @@ env: ORG_NAME: fluidos BASE_BRANCH: github - jobs: push_to_registry: name: Push Docker image to Docker Hub runs-on: ubuntu-latest steps: + - name: Check if the repository is "fluidos/energy-predictor" + run: | + if [ "${{ github.repository }}" != "fluidos/energy-predictor" ]; then + echo "This workflow is only for the fluidos/energy-predictor repository." + exit 0 + fi - name: Check out the repo uses: actions/checkout@v4 with: @@ -63,6 +68,7 @@ jobs: push: true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BASE_BRANCH }} , ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} , ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 # - name: Build Docker image with local git tag # run: |