change path .env and create .env file on the same job #27
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: Firebase CI | |
on: | |
push: | |
branches: main | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Make envfile | |
run: | | |
touch .env | |
echo EMAIL_API_KEY=${{ secrets.EMAIL_API_KEY }} >> .env | |
echo EMAIL_FROM=${{ secrets.EMAIL_FROM }} >> .env | |
echo EMAIL_TO=${{ secrets.EMAIL_TO }} >> .env | |
echo TEMPLATE_ID=${{ secrets.TEMPLATE_ID }} >> .env | |
- uses: actions/checkout@v3 | |
- name: Use Node.js version ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm i | |
- run: npm install -g firebase-tools | |
- run: npm run build | |
- name: Archive Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
deploy: | |
name: deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Build | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@v12.4.0 | |
with: | |
args: deploy --only hosting | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |