Update ci workflow to work with forgejo
This commit is contained in:
parent
245fae8183
commit
9f95fc12b5
1 changed files with 47 additions and 24 deletions
71
.github/workflows/ci.yml
vendored
71
.github/workflows/ci.yml
vendored
|
@ -13,30 +13,53 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
container: nixpkgs/nix-flakes:nixos-24.05
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Setup NIX CI Environment
|
||||||
with:
|
run: |
|
||||||
lfs: true
|
nix profile install nixpkgs#git-lfs nixpkgs#gnused
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
echo "substituters = https://nixpkgs-cache.qo.is?priority=39" >> /etc/nix/nix.conf
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" >> /etc/nix/nix.conf
|
||||||
- name: Run `nix build`
|
mkdir -p ~/.config/nix && cp /etc/nix/nix.conf ~/.config/nix/
|
||||||
|
- name: Checkout Repository
|
||||||
|
shell: "nix shell nixpkgs#git-lfs nixpkgs#gnused --command {0}"
|
||||||
|
run: |
|
||||||
|
git config --global credential.helper store
|
||||||
|
git config --global advice.detachedHead false
|
||||||
|
git lfs install
|
||||||
|
AUTH_URL=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%https://oauth2:$GITHUB_TOKEN@%"`
|
||||||
|
# Disable clone protection to pull LFS as well
|
||||||
|
GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $AUTH_URL/$GITHUB_REPOSITORY .
|
||||||
|
- name: Run Nix Build
|
||||||
|
shell: "nix shell nixpkgs#git-lfs --command {0}"
|
||||||
run: nix build .
|
run: nix build .
|
||||||
- uses: actions/upload-pages-artifact@v3
|
- name: Run Nix Checks
|
||||||
with:
|
shell: "nix shell nixpkgs#git-lfs --command {0}"
|
||||||
path: result/
|
run: nix flake check
|
||||||
|
- name: Deploy page
|
||||||
|
if: success() && github.ref == 'refs/heads/main'
|
||||||
|
shell: "nix shell nixpkgs#git-lfs --command {0}"
|
||||||
|
run: |
|
||||||
|
mkdir ~/.ssh/
|
||||||
|
(umask 0077 && printf "%s" "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 && echo >> ~/.ssh/id_ed25519)
|
||||||
|
echo -e "Host lindberg-webapps.backplane.net.qo.is\n StrictHostKeyChecking no" >> ~/.ssh/config
|
||||||
|
nix run .#deploy
|
||||||
|
# - uses: actions/upload-pages-artifact@v3
|
||||||
|
# with:
|
||||||
|
# path: result/
|
||||||
|
|
||||||
deploy:
|
# deploy:
|
||||||
environment:
|
# environment:
|
||||||
name: github-pages
|
# name: github-pages
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
# url: ${{ steps.deployment.outputs.page_url }}
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: build
|
# needs: build
|
||||||
permissions:
|
# permissions:
|
||||||
pages: write # to deploy to Pages
|
# pages: write # to deploy to Pages
|
||||||
id-token: write # to verify the deployment originates from an appropriate source
|
# id-token: write # to verify the deployment originates from an appropriate source
|
||||||
steps:
|
# steps:
|
||||||
- name: Deploy to GitHub Pages
|
# - name: Deploy to GitHub Pages
|
||||||
id: deployment
|
# id: deployment
|
||||||
uses: actions/deploy-pages@v4
|
# uses: actions/deploy-pages@v4
|
||||||
with:
|
# with:
|
||||||
preview: true
|
# preview: true
|
||||||
|
|
Loading…
Reference in a new issue