Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
push:
branches:
- main
release:
types: [created]
workflow_dispatch:

# Cancel any previous workflow.
# This can happen when we merge a PR that triggers a new release
# This can happen when we merge a PR that triggers a new release.
# The concurrency group uses the workflow name and the sha of the commit, so that
# we don't need to care whether it's a release or not.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true

permissions:
Expand All @@ -26,10 +26,6 @@ permissions:

jobs:
build-web:
if: >
(github.event_name == 'release' && github.event.action == 'created' ) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main')) ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
outputs:
neovim-lines: ${{ steps.lines.outputs.count }}
Expand Down Expand Up @@ -66,10 +62,6 @@ jobs:
path: ./dist/

build-cv:
if: >
(github.event_name == 'release' && github.event.action == 'created' ) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main')) ||
(github.event_name == 'workflow_dispatch')
needs: build-web # leverage pnpm cache reuse
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -105,7 +97,6 @@ jobs:
path: ./cv.pdf

deploy-cv:
if: github.event_name == 'release' && github.event.action == 'created' || github.event_name == 'workflow_dispatch'
needs: build-cv
runs-on: ubuntu-latest
env:
Expand All @@ -116,7 +107,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: cv
path: ./cv.pdf
path: .

- name: Upload PDF as Release Asset
uses: softprops/action-gh-release@v2
Expand All @@ -128,7 +119,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-web:
if: github.event_name == 'release' && github.event.action == 'created' || github.event_name == 'workflow_dispatch'
needs: build-web
runs-on: ubuntu-latest
environment:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

# temporary CV file (created during deployment)
src/cv.json
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ To actually do the deploy of the website and CV in release artifacts the followi

1. Create a PR which only bumps the version in package.json
2. By merging the PR it will trigger `release.yml` which in turn triggers `deploy.yml`.

# Test workflows locally
1. Install `act`, `gh`
2. Login in `gh` with `gh auth login`
3. Put manually `src/cv.json`
4. Comment `Write src/cv.json from input` step in `.github/actions/build-with-cv/action.yml`
5. Run `sh ./scripts/sh/test-workflow.sh <path to desired workflow>`

Caveats:
I've tested only `build-web` job which works properly, other workflows/jobs are not tested / are failing.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
[
nodejs_22 # Specify Node.js version
pnpm

# GitHub action local testing
act
gh
]
++ (with nvim-pkgs; [ nastro ]);

Expand Down
1 change: 1 addition & 0 deletions scripts/sh/test-workflow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
act workflow_dispatch --artifact-server-path $PWD/.artifacts -s GITHUB_TOKEN="$(gh auth token)" --use-new-action-cache -W "$1"
Loading