forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
927bf8a
commit 6ee32fc
Showing
3 changed files
with
4 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,127 +40,3 @@ jobs: | |
filename: ${{ steps.publish.outputs.filename }} | ||
checksum: ${{ steps.publish.outputs.checksum }} | ||
download: ${{ steps.publish.outputs.download }} | ||
|
||
guide: | ||
needs: source | ||
environment: website | ||
permissions: {} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/cockpit-project/unit-tests | ||
options: --user root | ||
steps: | ||
- name: Checkout website repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: website | ||
repository: cockpit-project/cockpit-project.github.io | ||
ssh-key: ${{ secrets.DEPLOY_KEY }} | ||
|
||
- name: Download source release | ||
run: curl -L -o '${{ needs.source.outputs.filename }}' '${{ needs.source.outputs.download }}' | ||
|
||
- name: Verify checksum | ||
run: echo '${{ needs.source.outputs.checksum }} ${{ needs.source.outputs.filename }}' | sha256sum -c | ||
|
||
- name: Build guide | ||
run: | | ||
mkdir source build | ||
tar --directory source --extract --strip-components=1 --file '${{ needs.source.outputs.filename }}' | ||
( | ||
cd build | ||
../source/configure | ||
make doc/guide/html/index.html | ||
) | ||
- name: Update the website | ||
run: | | ||
rm -rf website/guide/latest | ||
mv -Tv build/doc/guide/html website/guide/latest | ||
# Add frontmatter for Jekyll | ||
find website/guide/latest -name '*.html' -exec sed -i ' | ||
1i\ | ||
---\ | ||
layout: guide\ | ||
---' '{}' ';' | ||
git config --global user.name "GitHub Workflow" | ||
git config --global user.email "[email protected]" | ||
cd website | ||
git add guide/ | ||
git commit --message='Update guide to version ${{ github.ref_name }}' | ||
git show --stat | ||
git push origin main | ||
flathub: | ||
needs: source | ||
environment: flathub | ||
permissions: {} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: src | ||
|
||
- name: Checkout flathub repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: flathub | ||
repository: flathub/org.cockpit_project.CockpitClient | ||
ssh-key: ${{ secrets.DEPLOY_KEY }} | ||
# this is needed so we can push to a different repository | ||
fetch-depth: 0 | ||
|
||
- name: Update flathub repository | ||
run: | | ||
set -x | ||
DOWNLOAD='${{ needs.source.outputs.download }}' | ||
CHECKSUM='${{ needs.source.outputs.checksum }}' | ||
git config --global user.name "GitHub Workflow" | ||
git config --global user.email "[email protected]" | ||
cd flathub | ||
git checkout -b "${{ github.ref_name }}" | ||
git add "$(../src/containers/flatpak/prepare "${DOWNLOAD}" "${CHECKSUM}")" | ||
git commit -m "Update to version ${{ github.ref_name }}" | ||
git show | ||
git push [email protected]:cockpit-project/org.cockpit_project.CockpitClient HEAD | ||
node-cache: | ||
# doesn't depend on it, but let's make sure the build passes before we do this | ||
needs: [source] | ||
runs-on: ubuntu-latest | ||
environment: node-cache | ||
# done via deploy key, token needs no write permissions at all | ||
permissions: {} | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up git | ||
run: | | ||
git config user.name "GitHub Workflow" | ||
git config user.email "[email protected]" | ||
- name: Tag node-cache | ||
run: | | ||
set -eux | ||
# this is a shared repo, prefix with project name | ||
TAG="${GITHUB_REPOSITORY#*/}-$(basename $GITHUB_REF)" | ||
tools/node-modules checkout | ||
cd node_modules | ||
git tag "$TAG" | ||
git remote add cache "ssh://[email protected]/${GITHUB_REPOSITORY%/*}/node-cache" | ||
eval $(ssh-agent) | ||
ssh-add - <<< '${{ secrets.DEPLOY_KEY }}' | ||
# make this idempotent: delete an existing tag | ||
git push cache :"$TAG" || true | ||
git push cache tag "$TAG" | ||
ssh-add -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters