fixed bug related to chrome extension: not able to save token in cache #32
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 Railway | |
on: | |
push: | |
branches: | |
- develop | |
paths-ignore: | |
- 'README.md' | |
env: | |
WEBAPP_NAME: bookify | |
NODE_VERSION: '20.x' | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: 🗑️ Delete deployment | |
uses: strumwolf/delete-deployment-environment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
environment: 'develop' | |
onlyRemoveDeployments: true | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
- name: Setup Node.js version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Create .env file | |
run: | | |
echo "SQLITE_DB=${{ secrets.SQLITE_DB }}" >> .env | |
echo "TYPEORM_CLI=${{ secrets.TYPEORM_CLI }}" >> .env | |
echo "APP_PORT=${{ secrets.APP_PORT }}" >> .env | |
echo "NODE_ENV=${{ secrets.NODE_ENV }}" >> .env | |
echo "OAUTH_CLIENT_SECRET=${{ secrets.OAUTH_CLIENT_SECRET }}" >> .env | |
echo "OAUTH_CLIENT_ID=${{ secrets.OAUTH_CLIENT_ID }}" >> .env | |
echo "OAUTH_REDIRECT_URL=${{ secrets.OAUTH_REDIRECT_URL }}" >> .env | |
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env | |
- name: Install Client dependencies | |
run: cd client && npm install | |
- name: Build Client dependencies | |
run: cd client && npm run build | |
- name: Install Server Dependencies | |
run: npm install | |
- name: Run database migrations | |
run: npm run migration:run | |
- name: Build project | |
run: npm run build | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: node-app | |
path: . | |
deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- cleanup | |
environment: | |
name: 'develop' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: node-app | |
- name: Install Railway | |
run: npm i -g @railway/cli | |
- name: Deploy | |
run: railway up --service bookify | |
env: | |
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
- name: Get the deployment URL | |
run: echo "url=https://${{ env.WEBAPP_NAME }}-development.up.railway.app" >> $GITHUB_ENV |