diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..888dc79 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: deploy website preview +on: + push: + branches: + - release/* +jobs: + prepare: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[ci skip]') && ! contains(github.event.head_commit.message, '[skip ci]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: create deployment + uses: chrnorm/deployment-action@releases/v1 + id: deployment + with: + token: ${{ secrets.BOT_TOKEN }} + environment: staging + + - uses: ./ + id: now-deployment + with: + github-token: ${{ secrets.BOT_TOKEN }} + zeit-token: ${{ secrets.ZEIT_TOKEN }} + #ZEIT_TEAMID: amond + + - name: set deployment status (failure) + uses: chrnorm/deployment-action@releases/v1 + if: always() + with: + token: ${{ secrets.BOT_TOKEN }} + target-url: ${{ steps.now-deployment.outputs.preview-url }} + state: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + environment: staging + diff --git a/now.json b/now.json new file mode 100644 index 0000000..1856952 --- /dev/null +++ b/now.json @@ -0,0 +1,15 @@ +{ + "name": "zeit-now-deployment-action", + "version": 2, + "scope": "amond", + "public": false, + "github": { + "enabled": false + }, + "builds": [ + { "src": "./public/**", "use": "@now/static" } + ], + "routes": [ + { "src": "/(.*)", "dest": "public/$1" } + ] +} diff --git a/test/index.html b/public/index.html similarity index 100% rename from test/index.html rename to public/index.html