From b684ff8a78c678aa8a90936d1d978febff35fd49 Mon Sep 17 00:00:00 2001 From: Aaron Dalton Date: Sun, 7 Jan 2024 21:20:59 -0500 Subject: [PATCH] Update fork automation --- .github/workflows/crowdin.yml | 31 ----------------- .github/workflows/docker-publish.yml | 50 ++++++---------------------- .github/workflows/docs-publish.yml | 4 +-- .github/workflows/fork-sync.yml | 12 +++++++ 4 files changed, 25 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/crowdin.yml create mode 100644 .github/workflows/fork-sync.yml diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml deleted file mode 100644 index e7e473eb..00000000 --- a/.github/workflows/crowdin.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Crowdin Action - -on: - workflow_dispatch: - schedule: - - cron: '2 */12 * * *' - push: - paths: [ - '/public/locales/en/**', - ] - branches: [ main ] - -jobs: - synchronize-with-crowdin: - name: Crowdin Sync - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: crowdin action - uses: crowdin/github-action@v1 - with: - upload_translations: false - download_translations: true - crowdin_branch_name: main - localization_branch_name: l10n_main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} - CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3bea5512..3d20bfab 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -50,28 +50,20 @@ jobs: build: name: Docker Build & Push - if: github.repository == 'gethomepage/homepage' - runs-on: self-hosted + if: github.repository == 'discretizer/homepage' + runs-on: ubuntu-latest + needs: - pre-commit permissions: contents: read packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write + steps: - name: Checkout repository uses: actions/checkout@v4 - # Install the cosign tool except on PR - # https://github.com/sigstore/cosign-installer - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@main - with: - cosign-release: 'v1.13.1' # optional # Setup QEMU # https://github.com/marketplace/actions/docker-setup-buildx#with-qemu @@ -84,13 +76,13 @@ jobs: # This step is being disabled because the runner is on a self-hosted machine # where the cache will stick between runs. - # - name: Cache Docker layers - # uses: actions/cache@v3 - # with: - # path: /tmp/.buildx-cache - # key: ${{ runner.os }}-buildx-${{ github.sha }} - # restore-keys: | - # ${{ runner.os }}-buildx- + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- # Login against a Docker registry except on PR # https://github.com/docker/login-action @@ -132,23 +124,3 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,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: -# COSIGN_EXPERIMENTAL: "true" -# # This step uses the identity token to provision an ephemeral certificate -# # against the sigstore community Fulcio instance. -# run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }} - - # Temp fix - # https://github.com/docker/build-push-action/issues/252 - # https://github.com/moby/buildkit/issues/1896 - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 92900e25..d1dd9a98 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -36,7 +36,7 @@ jobs: test: name: Test Build - if: github.repository == 'gethomepage/homepage' && github.event_name == 'pull_request' + if: github.repository == 'discretizer/homepage' && github.event_name == 'pull_request' runs-on: ubuntu-latest needs: - pre-commit @@ -59,7 +59,7 @@ jobs: run: MKINSIDERS=false mkdocs build deploy: name: Build & Deploy - if: github.repository == 'gethomepage/homepage' && github.event_name != 'pull_request' + if: github.repository == 'discretizer/homepage' && github.event_name != 'pull_request' runs-on: ubuntu-latest needs: - pre-commit diff --git a/.github/workflows/fork-sync.yml b/.github/workflows/fork-sync.yml new file mode 100644 index 00000000..fb1114f0 --- /dev/null +++ b/.github/workflows/fork-sync.yml @@ -0,0 +1,12 @@ +on: + workflow_dispatch: + schedule: + - cron: '2 */12 * * *' + +jobs: + synchronize-upstream: + runs-on: ubuntu-latest + steps: + - run: gh repo sync discretizer/homepage + env: + GH_TOKEN ${{ secres.GITHUB_ENV }} \ No newline at end of file