CI に node 22 を追加する。 #44
Workflow file for this run
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 staging environment | |
on: pull_request | |
jobs: | |
copy-in: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
path: code | |
- name: Checkout pages | |
uses: actions/checkout@v2 | |
with: | |
repository: iij/seil2recipe-stg | |
token: ${{ secrets.STG_PAT }} | |
path: pages | |
- name: Copy | |
run: | | |
cd pages | |
NUM=${{ github.event.pull_request.number }} | |
rm -rf $NUM | |
mkdir $NUM | |
cp ../code/{index.html,seil2recipe.js,style.css} $NUM | |
cd $NUM | |
printf "/<header /a\n[stg]\n.\nwq\n" | ed -s index.html | |
echo 'textarea { background-color: yellow; }' >> style.css | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "deploy pull-request/$NUM" && git push || true | |
- name: Comment pull-request | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Deployed on https://iij.github.io/seil2recipe-stg/' + | |
'${{ github.event.pull_request.number }}' + '/index.html' | |
}) |