From 667a1117152c61615a8c06ea9f422274b29b1794 Mon Sep 17 00:00:00 2001 From: Simon <110519093+Simon-Drohsen@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:51:42 +0200 Subject: [PATCH 1/3] Create main.yml --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c451c74 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,53 @@ +name: Deployment + +on: + push: + branches: + - main + +jobs: + deployment: + runs-on: ubuntu-latest + environment: production + concurrency: production + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Create .env file + run: | + echo VUE_APP_MAPBOX_TOKEN=${{ secrets.VUE_APP_MAPBOX_TOKEN }} >> .env + echo VUE_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }} >> .env + echo VUE_APP_FIREBASE_PROJECT_ID=${{ secrets.VUE_APP_FIREBASE_PROJECT_ID }} >> .env + echo VUE_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }} >> .env + echo VUE_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }} >> .env + echo VUE_APP_FIREBASE_APP_ID=${{ secrets.VUE_APP_FIREBASE_APP_ID }} >> .env + echo VUE_APP_FIREBASE_MEASUREMENT_ID=${{ secrets.VUE_APP_FIREBASE_MEASUREMENT_ID }} >> .env + echo VUE_APP_FIREBASE_API_KEY=${{ secrets.VUE_APP_FIREBASE_API_KEY }} >> .env + + - name: Install dependencies + run: yarn install + + - name: Update firebase.js + run: | + sed -i 's|apiKey:.*|apiKey: process.env.VUE_APP_FIREBASE_API_KEY,|' src/config/firebase.js + sed -i 's|authDomain:.*|authDomain: process.env.VUE_APP_FIREBASE_AUTH_DOMAIN,|' src/config/firebase.js + sed -i 's|projectId:.*|projectId: process.env.VUE_APP_FIREBASE_PROJECT_ID,|' src/config/firebase.js + sed -i 's|storageBucket:.*|storageBucket: process.env.VUE_APP_FIREBASE_STORAGE_BUCKET,|' src/config/firebase.js + sed -i 's|messagingSenderId:.*|messagingSenderId: process.env.VUE_APP_FIREBASE_MESSAGING_SENDER_ID,|' src/config/firebase.js + sed -i 's|appId:.*|appId: process.env.VUE_APP_FIREBASE_APP_ID,|' src/config/firebase.js + sed -i 's|measurementId:.*|measurementId: process.env.VUE_APP_FIREBASE_MEASUREMENT_ID|' src/config/firebase.js + + - name: Build project + run: yarn build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist From 0b2637a6f7f27145f85266e34a82dabe66d2ab7b Mon Sep 17 00:00:00 2001 From: Simon <110519093+Simon-Drohsen@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:52:38 +0200 Subject: [PATCH 2/3] Rename main.yml to deployment.yml --- .github/workflows/{main.yml => deployment.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml => deployment.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/deployment.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/deployment.yml From ebaf68d1fd88239013f8f6adf8a563dc50397a8b Mon Sep 17 00:00:00 2001 From: Simon <110519093+Simon-Drohsen@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:05:51 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a062fb4..77e0617 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Deployment](https://github.com/instride-ch/mailblox-app/actions/workflows/deployment.yml/badge.svg?branch=main)](https://github.com/instride-ch/mailblox-app/actions/workflows/deployment.yml) # mailblox-app ## Project setup