Skip to content

Commit

Permalink
Add dotfiles for codespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Feb 18, 2022
1 parent 1f607d6 commit 96c8ebf
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Setup
description: Setup Node.js and install dependencies.

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: '16'
- name: Install dependencies
shell: bash
run: npm ci
52 changes: 52 additions & 0 deletions .github/workflows/codespaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: codespaces

on:
push:
branches:
- master
- codespaces

jobs:
dotfiles:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
id: import_gpg
with:
git-user-signingkey: true
git-commit-gpgsign: true
git-committer-name: ${{ secrets.GIT_USER_NAME }}
git-committer-email: ${{ secrets.GIT_USER_EMAIL }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: npm run codespaces
- name: Publish latest
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.CODESPACES_DEPLOY_KEY }}
publish_dir: .codespaces
keep_files: true
external_repository: razor-x/dotfiles
publish_branch: master
user_name: ${{ secrets.GIT_USER_NAME }}
user_email: ${{ secrets.GIT_USER_EMAIL }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: '16'
- name: Install dependencies
shell: bash
run: npm ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.codespaces
Gemfile.lock
npm-debug.log
bower_components/
Expand Down
7 changes: 7 additions & 0 deletions codespaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Codespaces dotfiles

My dotfiles for [GitHub Codespaces].
Generated from a subset of my [personal dotfiles].

[GitHub Codespaces]: https://github.com/features/codespaces
[personal dotfiles]: https://github.com/rxrc/dotfiles
44 changes: 44 additions & 0 deletions codespaces/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict'

const os = require('os')
const path = require('path')
const fs = require('fs')

const host = 'codespaces'
const rxrc = 'node_modules/@rxrc'

const targetRoot = path.resolve('.codespaces')

const ioType = 'linux'
const pkgType = 'noop'

const defaults = {
dmode: '0750',
fmode: '0640',
user: 'razorx',
group: 'razorx'
}

const unlinks = []

const directories = []

const files = [{
src: 'codespaces/README.md',
dst: 'README.md'
}, {
src: 'LICENSE.txt'
}]

const symlinks = []

module.exports = async () => ({
unlinks,
directories,
files,
symlinks,
targetRoot,
ioType,
pkgType,
defaults
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"start": "curator",
"codespaces": "curator",
"codespaces": "curator codespaces/manifest.js",
"postversion": "git push && git push --tags"
},
"dependencies": {
Expand Down

0 comments on commit 96c8ebf

Please sign in to comment.