This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
Use download_artifact v4 for compatibility (#150) #77
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
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [site-v2] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
repo-generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout your repository using git | |
uses: actions/checkout@v4 | |
- name: Install required packages | |
run: | | |
until sudo apt update | |
do | |
sleep 1 | |
done | |
sudo apt install -y jq coreutils gnupg2 dpkg-dev createrepo-c | |
- name: Insert environment variables | |
run: | | |
echo GNUPGHOME="$(mktemp -d /tmp/pgpkeys-XXXXXX)" >> $GITHUB_ENV | |
echo REPO_OWNER="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f1)" >> $GITHUB_ENV | |
echo REPO_NAME="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f2)" >> $GITHUB_ENV | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.PGP_PRIVATE_KEY }} | |
- name: Build DEB/RPM Repos | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export GPG_FINGERPRINT="${{ steps.import_gpg.outputs.fingerprint }}" | |
export ORIGIN="${{ steps.import_gpg.outputs.name }}" | |
export GPG_TTY="$(tty)" | |
.github/scripts/create_repos.sh | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "generated_repo/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "./generated_repo" | |
name: repo | |
build-install-deploy-astro-rpm-deb-artifacts: | |
needs: repo-generate | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout your repository using git | |
uses: actions/checkout@v4 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.10.5 | |
- name: Build landing site | |
shell: "bash" | |
run: | | |
cd ./site/landing | |
pnpm install | |
pnpm run build | |
- name: Build docs site | |
shell: "bash" | |
run: | | |
cd ./site/docs | |
pnpm install | |
pnpm run build | |
- name: Copy docs site dist to landing site | |
shell: "bash" | |
run: | | |
cp -a ./site/docs/dist ./site/landing/dist/docs | |
- name: Download repo artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: repo | |
- name: Untar the artifact | |
run: | | |
mkdir -p dist/packages | |
tar -xvf ../../artifact.tar -C dist/packages | |
working-directory: ./site/landing | |
- name: Copy gpg public key to landing site | |
shell: "bash" | |
run: | | |
cp ./deploy/camblet-public.asc ./site/landing/dist/packages/camblet.asc | |
- name: Copy install script to landing site | |
shell: "bash" | |
run: | | |
cp ./deploy/install.sh ./site/landing/dist/install.sh | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "./site/landing/dist" | |
deploy: | |
needs: build-install-deploy-astro-rpm-deb-artifacts | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
test-package: | |
needs: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install camblet-driver and camblet-agent packages | |
run: curl -s https://camblet.io/install.sh | bash |