From d7462401daa96ffe79808db26678bfc349934650 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 10 Jan 2024 20:51:23 +0100 Subject: [PATCH] ci: new deploy workflow --- .github/workflows/deploy.yml | 39 +++++++++++++++++++++++++++++ .github/workflows/website.yml | 41 ------------------------------- firebase.json | 46 ----------------------------------- 3 files changed, 39 insertions(+), 87 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/website.yml delete mode 100644 firebase.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..27561f25 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy + +on: + push: + tags: ["*"] + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "deploy" + cancel-in-progress: true + +jobs: + deploy: + if: ${{ github.repository == 'jmjuanes/siimple' }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - uses: actions/configure-pages@v1 + - run: yarn install + - run: yarn run build + - run: yarn run build:website + - uses: actions/upload-pages-artifact@v1 + with: + path: public + - uses: actions/deploy-pages@v1 + id: deployment diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml deleted file mode 100644 index 980d3c34..00000000 --- a/.github/workflows/website.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy Website - -on: - push: - branches: [main] - release: - types: [created] - -jobs: - website: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16 - - run: yarn install - - run: yarn run build - - run: yarn run build:website - - - name: Add configuration (devel) - if: github.event_name == 'push' - run: 'echo "$FIREBASE_CONFIG" > ./.firebaserc' - shell: bash - env: - FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG_DEVEL }} - - - name: Add configuration (production) - if: github.event_name == 'release' - run: 'echo "$FIREBASE_CONFIG" > ./.firebaserc' - shell: bash - env: - FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG_WEBSITE }} - - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" - projectId: "${{ secrets.FIREBASE_PROJECT }}" - channelId: live - target: website diff --git a/firebase.json b/firebase.json deleted file mode 100644 index 6be941fd..00000000 --- a/firebase.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "hosting": { - "target": "website", - "public": "public", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**", - ".env" - ], - "redirects": [ - { - "source": "/docs/recipes/*", - "destination": "/examples", - "type": 301 - }, - { - "source": "/docs/:folder/:file", - "destination": "/:folder/:file", - "type": 301 - }, - { - "source": "/docs/:file", - "destination": "/:file", - "type": 301 - }, - { - "source": "/docs/", - "destination": "/getting-started", - "type": 301 - }, - { - "source": "/guides/styles", - "destination": "/syntax", - "type": 301 - } - ], - "rewrites": [ - { - "source": "/playground/**", - "destination": "/playground/index.html" - } - ], - "trailingSlash": false - } -} \ No newline at end of file