mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 06:28:34 +01:00
fix(ci): updates existing ci job to work with new docker publishing. (#30)
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
name: Publish Release
|
name: Publish Release Binaries
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags: [ 'v*.*.*' ]
|
||||||
- v*
|
|
||||||
|
|
||||||
env:
|
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
backend-tests:
|
backend-tests:
|
||||||
@@ -49,29 +45,3 @@ jobs:
|
|||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
publish-tag:
|
|
||||||
name: "Publish Tag"
|
|
||||||
uses: sysadminsmedia/homebox/.github/workflows/partial-publish.yaml@main
|
|
||||||
with:
|
|
||||||
release: true
|
|
||||||
tag: ${{ github.ref_name }}
|
|
||||||
secrets:
|
|
||||||
GH_TOKEN: ${{ secrets.CR_PAT }}
|
|
||||||
|
|
||||||
deploy-docs:
|
|
||||||
name: Deploy docs
|
|
||||||
needs:
|
|
||||||
- publish-tag
|
|
||||||
- goreleaser
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout main
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Deploy docs
|
|
||||||
uses: mhausenblas/mkdocs-deploy-gh-pages@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
CONFIG_FILE: docs/mkdocs.yml
|
|
||||||
EXTRA_PACKAGES: build-base
|
|
||||||
15
.github/workflows/docker-publish-rootless.yaml
vendored
15
.github/workflows/docker-publish-rootless.yaml
vendored
@@ -88,21 +88,6 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
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.metadata.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}
|
|
||||||
|
|
||||||
- name: Attest
|
- name: Attest
|
||||||
uses: actions/attest-build-provenance@v1
|
uses: actions/attest-build-provenance@v1
|
||||||
id: attest
|
id: attest
|
||||||
|
|||||||
15
.github/workflows/docker-publish.yaml
vendored
15
.github/workflows/docker-publish.yaml
vendored
@@ -86,21 +86,6 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
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}
|
|
||||||
|
|
||||||
- name: Attest
|
- name: Attest
|
||||||
uses: actions/attest-build-provenance@v1
|
uses: actions/attest-build-provenance@v1
|
||||||
id: attest
|
id: attest
|
||||||
|
|||||||
89
.github/workflows/partial-publish.yaml
vendored
89
.github/workflows/partial-publish.yaml
vendored
@@ -1,89 +0,0 @@
|
|||||||
name: Frontend / E2E
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
release:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
GH_TOKEN:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
name: "Publish Homebox"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.20"
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
id: qemu
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
with:
|
|
||||||
image: tonistiigi/binfmt:latest
|
|
||||||
platforms: all
|
|
||||||
|
|
||||||
- name: install buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
|
|
||||||
- name: login to container registry
|
|
||||||
run: docker login ghcr.io --username hay-kot --password $CR_PAT
|
|
||||||
env:
|
|
||||||
CR_PAT: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
- name: build nightly image
|
|
||||||
if: ${{ inputs.release == false }}
|
|
||||||
run: |
|
|
||||||
docker build --push --no-cache \
|
|
||||||
--tag=ghcr.io/sysadminsmedia/homebox:${{ inputs.tag }} \
|
|
||||||
--build-arg=COMMIT=$(git rev-parse HEAD) \
|
|
||||||
--build-arg=BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
|
||||||
--platform=linux/amd64,linux/arm64,linux/arm/v7 .
|
|
||||||
|
|
||||||
- name: build nightly-rootless image
|
|
||||||
if: ${{ inputs.release == false }}
|
|
||||||
run: |
|
|
||||||
docker build --push --no-cache \
|
|
||||||
--tag=ghcr.io/sysadminsmedia/homebox:${{ inputs.tag }}-rootless \
|
|
||||||
--build-arg=COMMIT=$(git rev-parse HEAD) \
|
|
||||||
--build-arg=BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
|
||||||
--file Dockerfile.rootless \
|
|
||||||
--platform=linux/amd64,linux/arm64,linux/arm/v7 .
|
|
||||||
|
|
||||||
- name: build release tagged the image
|
|
||||||
if: ${{ inputs.release == true }}
|
|
||||||
run: |
|
|
||||||
docker build --push --no-cache \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:nightly \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:latest \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:${{ inputs.tag }} \
|
|
||||||
--build-arg VERSION=${{ inputs.tag }} \
|
|
||||||
--build-arg COMMIT=$(git rev-parse HEAD) \
|
|
||||||
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 .
|
|
||||||
|
|
||||||
- name: build release tagged the rootless image
|
|
||||||
if: ${{ inputs.release == true }}
|
|
||||||
run: |
|
|
||||||
docker build --push --no-cache \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:nightly-rootless \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:latest-rootless \
|
|
||||||
--tag ghcr.io/sysadminsmedia/homebox:${{ inputs.tag }}-rootless \
|
|
||||||
--build-arg VERSION=${{ inputs.tag }} \
|
|
||||||
--build-arg COMMIT=$(git rev-parse HEAD) \
|
|
||||||
--build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
|
||||||
--file Dockerfile.rootless .
|
|
||||||
29
.github/workflows/publish.yaml
vendored
29
.github/workflows/publish.yaml
vendored
@@ -1,29 +0,0 @@
|
|||||||
name: Publish Dockers
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
env:
|
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: "Deploy Nightly to Fly.io"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
|
||||||
- run: flyctl deploy --remote-only
|
|
||||||
|
|
||||||
publish-nightly:
|
|
||||||
name: "Publish Nightly"
|
|
||||||
if: github.event_name != 'release'
|
|
||||||
uses: sysadminsmedia/homebox/.github/workflows/partial-publish.yaml@main
|
|
||||||
with:
|
|
||||||
tag: nightly
|
|
||||||
secrets:
|
|
||||||
GH_TOKEN: ${{ secrets.CR_PAT }}
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user