Lock file maintenance (#485) #247
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 (Stage) | |
on: | |
push: | |
branches: | |
- "main" | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh-agent.sock | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
environment: | |
name: stage | |
url: ${{ vars.BASE_URL }}/rss-staging | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Configure environment | |
run: | | |
cat << .end > src/local.js | |
export const urls = { | |
app: "${{ vars.BASE_URL }}/rss-staging", | |
proxy: "${{ vars.BASE_URL }}/json/roxy", | |
referrers: "${{ vars.BASE_URL }}/json/ferris?group=rss-box" | |
}; | |
.end | |
- name: Setup SSH agent | |
run: | | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | |
mkdir -p ~/.ssh | |
echo '${{ vars.SSH_CONFIG }}' > ~/.ssh/config | |
echo '${{ vars.SSH_KNOWN_HOSTS }}' > ~/.ssh/known_hosts | |
- name: Bump version number | |
run: | | |
date=$(date +"%y.%-m.%-d") | |
jq < package.json | jq ".version |= \"$date\"" > package.json.tmp | |
mv package.json.tmp package.json | |
- name: Publish to staging environment | |
run: | | |
npm ci --ignore-scripts | |
npm run deploy:staging |