From d424ec6074915ea8518bb7904c9a445b34209875 Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 22 Jun 2021 10:15:51 -0700 Subject: [PATCH 1/2] Workflow action to deploy develop to S3 --- .github/workflows/deploy_develop.yml | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/deploy_develop.yml diff --git a/.github/workflows/deploy_develop.yml b/.github/workflows/deploy_develop.yml new file mode 100644 index 0000000000..b3cafcc823 --- /dev/null +++ b/.github/workflows/deploy_develop.yml @@ -0,0 +1,63 @@ +name: Deploy to the develop live server + +on: + push: + branches: + - master + +jobs: + api_data: + runs-on: ubuntu-latest + + # protect those who work in their fork + if: github.repository == 'qmk/qmk_configurator' + + steps: + - uses: actions/checkout@v2 + + - id: nodeversion + run: echo ::set-output name=NODE::$(cat .nvmrc) + + - name: restore Cache + uses: actions/cache@master + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + + - name: Use Node.js ${{steps.nodeversion.outputs.NODE}} + uses: actions/setup-node@v1 + with: + node-version: ${{ steps.nodeversion.outputs.NODE }} + + - name: install + run: | + yarn + + - name: Lint + run: | + yarn run prettier:check + yarn run prettier:json:check + yarn run lint + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + start: yarn serve + wait-on: "http://localhost:8080" + + - name: build + run: | + echo VUE_APP_TRAVIS_COMMIT=$GITHUB_SHA >> .env.production + yarn run build + echo config.develop.qmk.fm > dist/CNAME + + - name: Deploy Develop Configurator + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.CONFIG_SPACE_DEVELOP }} + AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }} + AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com + SOURCE_DIR: "dist" From 4ebcead5f0111202745014d7484a3082fcc44a95 Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 22 Jun 2021 11:11:23 -0700 Subject: [PATCH 2/2] set the develop metadata url --- .github/workflows/deploy_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy_develop.yml b/.github/workflows/deploy_develop.yml index b3cafcc823..5059cb6725 100644 --- a/.github/workflows/deploy_develop.yml +++ b/.github/workflows/deploy_develop.yml @@ -47,9 +47,9 @@ jobs: - name: build run: | + sed -i 's,\(VUE_APP_KEYBOARDS_URL=\).*,\1https://keyboards.develop.qmk.fm,' .env.production echo VUE_APP_TRAVIS_COMMIT=$GITHUB_SHA >> .env.production yarn run build - echo config.develop.qmk.fm > dist/CNAME - name: Deploy Develop Configurator uses: jakejarvis/s3-sync-action@master