Fix one typo at github actions setup #150
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: Staging and production deployment | |
on: | |
push: | |
branches: | |
- main | |
- production | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Your existing test steps from the original workflow would go here | |
- name: Placeholder for existing test steps | |
run: echo "Your existing test steps would go here" | |
deploy-production: | |
# needs: test # This ensures deployment only happens after tests pass | |
if: github.ref == 'refs/heads/production' # Only run this job for production branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Vue3 project | |
run: npm run build | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
- name: Deploy to remote server | |
run: | | |
rsync -avz --delete dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/virtual/ut/lacune-map.de | |
- name: Send deployment notification | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: ${{ secrets.SMTP_SERVER }} | |
server_port: ${{ secrets.SMTP_PORT }} | |
username: ${{ secrets.SMTP_USERNAME }} | |
password: ${{ secrets.SMTP_PASSWORD }} | |
subject: Lacune Map Production Deployment completed | |
body: | | |
Es gibt ein Update für die Lacune Map. | |
Ein neues Production Deployment wurde erfolgreich abgeschlossen. :) | |
There is an update for the Lacune Map. | |
A new production deployment has been successfully completed. :) | |
Lg, A Thousand Channels | |
Changes: | |
${{ github.event.head_commit.message }} | |
Commit: ${{ github.sha }} | |
Timestamp: ${{ github.event.head_commit.timestamp }} | |
from: ${{ secrets.MAIL_FROM }} | |
to: ${{ secrets.MAIL_TO }} | |
secure: true | |
deploy-staging: | |
# needs: test # This ensures deployment only happens after tests pass | |
if: github.ref == 'refs/heads/main' # Only run this job for main branch | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [20] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout code 📔 | |
uses: actions/checkout@master | |
- name: Setup node env 🪑 | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Print node-version 🖨 | |
run: node -v | |
- name: Install dependencies 📦 | |
run: npm install | |
- name: Generate 🔩 | |
run: npm run build | |
env: | |
PUBLIC_PATH: '/lacune-map/' | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload dist folder | |
path: './dist' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Deploy to GitHub Pages 🏁 | |
id: deployment | |
uses: actions/deploy-pages@v4 | |