GitHub Actions を動かす #78
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 develop.wandbox.org | |
on: | |
push: | |
branches: | |
- develop | |
- feature/update-ubuntu-24.04 | |
jobs: | |
deploy: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Register SSH key | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: | | |
mkdir -p $HOME/.ssh | |
echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_ed25519 | |
chmod 600 $HOME/.ssh/id_ed25519 | |
- name: Add SSH config | |
env: | |
SSH_HOST: ${{ secrets.SSH_HOST_UBUNTU_24_04 }} | |
SSH_USER: ${{ secrets.SSH_USER }} | |
run: | | |
set -ex | |
echo "Host wandbox-ubuntu-24.04" >> $HOME/.ssh/config | |
echo " HostName $SSH_HOST" >> $HOME/.ssh/config | |
echo " User $SSH_USER" >> $HOME/.ssh/config | |
echo " ServerAliveInterval 60" >> $HOME/.ssh/config | |
echo " TCPKeepAlive yes" >> $HOME/.ssh/config | |
ssh-keyscan -H $SSH_HOST >> $HOME/.ssh/known_hosts | |
- name: apt install | |
run: sudo apt-get install -y libcap-dev | |
- name: Get cached tools | |
id: cache-tools | |
uses: actions/cache@v4 | |
with: | |
path: _install | |
key: install-deps-v3 | |
- name: Package cattleshed | |
run: python3 run.py package --env develop cattleshed | |
- name: Package kennel | |
run: python3 run.py package --env develop kennel | |
# - name: Deploy cattleshed to develop.wandbox.org | |
# run: | | |
# ./deploy.sh wandbox-ubuntu-24.04 cattleshed master | |
# - name: Deploy kennel to develop.wandbox.org | |
# run: | | |
# ./deploy.sh wandbox-ubuntu-24.04 kennel master | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules-v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('canine/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build Workers | |
working-directory: canine | |
run: | | |
set -ex | |
npm install | |
npm run build | |
# - name: Publish canine | |
# working-directory: canine | |
# env: | |
# CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
# run: | | |
# set -ex | |
# npm install -g @cloudflare/wrangler | |
# npm run deploy:dev |